I would like to understand how to make Hello.js work with React.js, especially the custom event handler hello.on
Since I am new to React.js, I don’t understand how to bind non-react events in the application thread.
I tried to put an event handler in a handler componentDidMount
handleClick(){
hello('twitter').login();
}
componentDidMount(){
hello.on('auth.login', function(auth) {
hello(auth.network).api('/me').then(function(r) {
console.log(r);
});
});
hello.init({
'twitter' : 'J1jqqO50tcLtLx8Js0VDitjZW'
},
{
redirect_uri:'/',
oauth_proxy: 'https://auth-server.herokuapp.com/proxy'
});
}
thank
source
share