Call React.render multiple times on the handler
Am i allowed to call the render method on the handler multiple times on each:
Router.run(routes, function (Handler, state) ... ?
React.render(
i first noticed that willTransitionFrom isn't fired after the first history back/forward navigation. seems like this is because prevRoutes in 355 is empty
Am i allowed to call the render method on the handler multiple times
Yes.
seems like this is because prevRoutes in 355 is empty
This was fixed in 90cd7502caa157068849da85e0eec972ec175a19. Please update to version 0.11.6.
i still got that issue.
i can easily replicate the issue just by calling:
React.render(<Handler data={data}/>, document.getElementById('example'));
React.render(<Handler data={data}/>, document.getElementById('example'));
twice in a row.
willTransitionFrom won't be called consistently (usually just once)
prevRoutes in create Router is still empty
I'm trying understand.
I'm assuming the URL is not changing between renders but you expect willTransitionFrom to be called?
Yes, nextState is being reset in updateState, triggered by each render. This prevents willTransitionFrom from being called on subsequent route calls. I don't expect it to be called on each render.
Simply moving the nextState reset before
nextState.path = path;
Seems to solve it.
On Sunday, December 21, 2014, Ryan Florence [email protected] wrote:
I'm trying understand.
I'm assuming the URL is not changing between renders but you expect willTransitionFrom to be called?
— Reply to this email directly or view it on GitHub https://github.com/rackt/react-router/issues/627#issuecomment-67774962.
Ah, gotcha. A failing test case pull request would be invaluable.
Typically I cause a rerender in my root route handler and everything works out, but being able to render the run callback's Handler would be great.