Ask questionsFailed prop type: Invalid prop 'component' supplied to 'Route': the prop is not a valid React component
I have a reference to an object containing getComponent(...) method for obtaining a React component.
I try to render this component inside a nested route like so:
const component = React.cloneElement(object.getComponent(...), {...});
<Route path={`home/${object.route}`} component={component}/>;
and I get the following error:
Failed prop type: Invalid prop 'component' supplied to 'Route': the prop is not a valid React component.
I've seen similar issues like 6741
where the issue is resolved by upgrading the library version to [email protected], but my dependencies are up-to date:
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-router-dom": "^5.0.0"
Any ideas on how can I solve this problem ?
Answer
questions
support[bot]
:wave: @Kashio, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. For usage questions, please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out. Please feel free to clarify your issue if you think it was closed prematurely.
Related questions