setProps with react
Can’t pass props (from outside) using react-router When rendering with react-router, React.render(routes, document.body).setProps({prop:”val”}) doesn’t work because the top-level is Route ReactElement and the second level is ActiveCommponent ReactElement and when we acces it with React.render(routes, document.body).getActiveComponent().setProps({prop:”val”}) we get the Anti-Pattern (violation for not using the top element to pass props)
Can't you pass them during route setup? https://github.com/rackt/react-router/blob/master/docs/api/components/Route.md#prop
this is related to a number of problems with the API that we're fixing right now on the new-api branch. We'll be asking for people to try it out soon, wish we could work faster!