Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component not unmounting on goBack() #65

Open
lukefanning opened this issue Nov 16, 2016 · 3 comments
Open

Component not unmounting on goBack() #65

lukefanning opened this issue Nov 16, 2016 · 3 comments

Comments

@lukefanning
Copy link

Hi, I am facing an issue with a fairly simple usage of this module. I am finding that after calling goBack() on the router it does not trigger a componentWillUnmount(). Here is my route configuration:

<Router history={nativeHistory}>
        <StackRoute path="master" component={App}>
            <Route
                path="/" component={ChatPage} overlayComponent={(props)=><DefaultHeader {...props} title="Home"/>}/>
            <Route
                path="/chat/:name/:id" component={RoomPage} overlayComponent={(props)=><DefaultHeader {...props} title={props.params.name}/>}/>
            <Route
                path="/other" component={OtherPage} overlayComponent={(props)=><DefaultHeader {...props} title="Other Page"/>}/>
        </StackRoute>
</Router>

What seems to happen is, if I use router.push() to go from path "/" to "/chat/:name/:id" I get a call to componentDidMount() and componentWillReceiveProps(). On calling router.goBack(), componentWillUnmount() is not triggered. If I go back to the exact same chat link then it will call componentDidMount() and componentWillReceiveProps() again.

Version

Dependency Version
react-router-native 2.0.0-beta.0
react-router N/A
react-native 0.37.0
@ophite
Copy link

ophite commented Feb 9, 2017

Very similar situation ,when push from one screen to next, did not fire componentWillUnmount

@pilord12
Copy link

Seeing the same issue. Any updates on this?

@mgiridhar
Copy link

I am facing the same issue. Is there a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants