-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Closed
Labels
Description
I have a class that is trying to do a get request in the componentDidMount function, however if I initially load a page with this component in it I get the following error. $ is not defined. I followed the example from xxx I just changed it over to ES6, perhaps I am using something improperly?
`
class NativeApp extends React.Component {
state = {
banners : {}
}
loadBanners() {
this.serverRequest = $.get('/api/banners', function (res) {
this.setState(res)
}.bind(this))
}
componentDidMount() {
this.loadBanners()
}
render() {
return (
Manually Load Banners WHY!!!
)
}
}
export default NativeApp
`
Reactions are currently unavailable