Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

switch between /posts/1 and posts/2 will not trigger queries #31

Closed
lilee opened this issue Jun 19, 2015 · 2 comments
Closed

switch between /posts/1 and posts/2 will not trigger queries #31

lilee opened this issue Jun 19, 2015 · 2 comments
Assignees

Comments

@lilee
Copy link

lilee commented Jun 19, 2015

because /posts/1 and /posts/2 route to the same handler, so componentWillMount can not be invoked. React Only invoke render function.

I think react-transimit should implement componentWillReceiveProps method, like

componentWillReceiveProps: function(nextProps) {
    var needToLoad = !shallowEqual(
        nextProps.queryParams,
        this.props.queryParams
    );
    if (needToLoad) {
        this.setQueryParams(nextProps.queryParams);
    }
}

the new react-router implements the similar function https://github.com/rackt/react-router/blob/master/modules/experimental/AsyncProps.js#L40

@RickWong
Copy link
Owner

RickWong commented Jul 2, 2015

Thanks for reporting this, @lilee.

@RickWong RickWong self-assigned this Jul 2, 2015
@lilee
Copy link
Author

lilee commented Jul 5, 2015

I submit the Pull Request

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

No branches or pull requests

2 participants