-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
react-router allows you to override the createElement function when rendering a route component. For example:
<Router history={browserHistory} createElement={createElement}>{...}</Router>
const createElement = (Component, props) => (
props.route.dependencies = props.route.dependencies || {};
return React.createElement(Component, { ...props, ...props.route.dependencies });
);This createElement function is not a component (a component is a pure function of the props, but in this case it has two parameters, the component and the props), however, eslint recognizes it as one and demands that the propTypes be defined. Maybe the component recognition as specified here: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md can be narrowed down to functions with only one parameter.
Edit: the error I get is 'route' is missing in props validation (react/prop-types)
Reactions are currently unavailable