Archives : July-2016

What is the correct way to validate route props in React class? I tried: route: React.PropTypes.object – my eslint complains: Prop type object is forbidden react/forbid-prop-types route: React.PropTypes.instanceOf(React.propTypes) – this results in a warning at runtime: Right-hand side of ‘instanceof’ is not callable Check the render method of bla We have the policy to validate ..

Read more

I want to show a progress bar when I switch one route from another, I found this package: nprogress, for youtube-like progress. My problem is implementing this using React Router. I somehow need to execute NProgress.start(); on every start of routing, and NProgress.done(); when loaded. Is there a better way (like a middleware between route ..

Read more

Assuming my app’s base url is example.com/app Is it possible to set a base route in react-router so instead of writing all routes as /app/a /app/b /app/c I can just specify them as a b c I tried the below example I found in the docs but it wouldn’t work (page would display nothing). Maybe ..

Read more