You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Add <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> in your header.
This is a usage question, rather than a bug in the React core. Usage questions are better answered on sites like StackOverflow, as we try to use github issues for tracking bugs in the React core. For this reason, I'm going to close out this issue, but feel free to continue the conversation on this thread or move it to StackOverflow.
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
`
The text was updated successfully, but these errors were encountered: