Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

(Transmit/Routing) this.props.setQueryParams must be called in componentWillMount or routing does not work properly... #56

Closed
tylermadison opened this issue Aug 3, 2015 · 2 comments
Labels

Comments

@tylermadison
Copy link

In Main.js componentWillMount() method in the if(__CLIENT__) { } block if you take out the additional call to this.props.setQueryParams({...etc}) routes do not behave properly.

@tylermadison tylermadison changed the title (Transmit) this.props.setQueryParams must be called in componentWillMount or routing does not work properly... (Transmit/Routing) this.props.setQueryParams must be called in componentWillMount or routing does not work properly... Aug 3, 2015
@RickWong RickWong added the bug label Aug 4, 2015
@RickWong
Copy link
Owner

I can't reproduce this issue in the latest release. There have been some changes under the hood. Reopen if this is still an issue.

@tmadison-gpsw
Copy link

This is still an issue in the latest version. If you have a nested route and navigate to it via a <Link /> it re-renders both components. If you call this.props.transmit.forceFetch({}) in componentWillMount in the Main component, the routes work as expected and do not cause the re-render.

In Routes.js

export default (
  <Router>
    <Route path="/" component={Main}>
      <Route path=":id" component={Detail} />
    </Route>
  </Router>
);

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

No branches or pull requests

3 participants