Passing props to route
I want to pass props to routes. I am doing it this way but getting error.
Failed prop type: Invalid prop routes supplied to Router in Router
Anyone knows what I am doing wrong
const routeConfig = (type) => {
return (
<Route>
<Route path='/' component={Template}>
<Route path='/pageform(/:id)' component={PageForm} />
</Route>
<Route path='/:pageSlug' component={Page} type=type/>
</Route>
);
}
class App extends React.Component {
render() {
return (
<MuiThemeProvider muiTheme={getMuiTheme()}>
<Provider store={store}>
<Router history={browserHistory} routes={routeConfig type='abc'} />
</Provider>
</MuiThemeProvider>
);
};
};
Shouldn't it be <Route path='/pageform/:id' component={PageForm} />
@priyadhoundiyal : The params is optional that's why it has been written as
<Route path='/pageform(/:id)' component={PageForm} />
rather than
<Route path='/pageform/:id' component={PageForm} />
The problem is with passing the props argument type which i don't know is write way to do or not
This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux. Thanks!