I am new to react-router and I just started writing an app using react-router V4. I would like to to pass props to components rendered by <Match />
and I am wondering about what's the 'best' or 'proper' way to do so.
Is it by doing something like this?
<Match pattern="/" render={
(defaultProps) => <MyComponent myProp = {myProp} {...defaultProps} />
}/>
Is this (passing props to components to be rendered by <Match />
) even a good practice to do so with react-router or is it an antipattern or something; and if so, why?