Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
const handleAsyncActions = async () => {
await this.props.loginSuccess({ login: { data: { ...data } } });
await localStorage.setItem('oauth', b64EncodeUnicode(JSON.stringify(data)));
await this.props.history.push('/dashboard');
};
handleAsyncActions();
How to solve this problem in best way.