Open prakasa1904 opened 6 years ago
Same issue :(
same issue over here
re mount your component guys, thats the only one solution. react-social-login use CDM for fetch the SDK. Its works for me.
@prakasa1904 how did you achieve remounting?
I declared a state variable rerender: false
& then in failureHandler toggle it. And have added a key props to the SocialButtons that is a string which interpolates and creates new key each time, forcing the mount.
@prakasa1904 how do u remount component? pls, im newbie in react
just initial state, to make your component reactSocialLogin remount. For example rerender: false
.
Then setState twice in the react social media error fallback. Then, the react social login component will remount and trigger CDM.
Or, you can modify lifecycle from this libs. Its better for me, I already modify this libs so it easier than before 💃
get reactSosmedLoginPorops() {
// react social login props here
return {
...props,
onLoginFailure: this.errorCallback
}
}
errorCallback = (err) => {
// do something
this.setState({ rerender: true }, () => { this.setState({ rerender: false; })})
}
render() {
const { rerender } = this.sate;
return !rerender ? <ReactSosmedLogin { ...this.reactSosmedLoginPorops }> : null;
}
thz 😃 @prakasa1904
How to handler if user close pop up ? because its just callback to error fuction, no object data provide to be process....
And also, when we try to relogin, callback already set with
Fetching user