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
{{ message }}
This repository was archived by the owner on Oct 26, 2018. It is now read-only.
I'm having this issue when using redux simple router with setRouteLeaveHook on the context my routerWillLeave callback executes twice.
classMyComponentextendsReact.Component{constructor(props,context){super(props,context);this.routerWillLeaveCallCount=0;}componentDidMount(){this.context.router.setRouteLeaveHook(this.props.route,this.routerWillLeave.bind(this));}routerWillLeave(route){console.log(route.action);if(this.hasUnsavedData()&&this.routerWillLeaveEvenCallCount()){return'You have an unsaved data, are you sure you want to leave?';}}routerWillLeaveEvenCallCount(){returnthis.routerWillLeaveCallCount++%2===0;}