In V6, you can’t use the component
prop anymore. It was replaced in favor of element
:
<Route path="/" element={<Home />}></Route>
More info in the migration doc.
More Related Contents:
- Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function but got: object
- “SyntaxError: Unexpected token < in JSON at position 0"
- Pass props in Link react-router
- Is it safe to store a JWT in localStorage with ReactJS?
- React Router with optional path parameter
- Use anchors with react-router
- react-router getting this.props.location in child components
- Uncaught TypeError: Cannot read property ‘push’ of undefined (React-Router-Dom)
- How to add custom html attributes in JSX
- Multiple Nested Routes in react-router-dom v4
- Node.js Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0
- ‘react-scripts’ is not recognized as an internal or external command
- How do I reload a page with react-router?
- How do you import a javascript package from a cdn/script tag in React?
- onEnter not called in React-Router
- XMLHttpRequest cannot load No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000’ Google maps
- React.js Serverside rendering and Event Handlers
- react-router go back a page how do you configure history?
- unable to deploy next js to azure
- How to manually invoke Link in React-router?
- Material-ui adding Link component from react-router
- How to use normal anchor links with react-router
- React router global header
- Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module ‘babel-preset-react’
- ReactJS server-side rendering vs client-side rendering
- How to deploy a React + NodeJS Express application to AWS?
- React Router BrowserRouter leads to “404 Not Found – nginx ” error when going to subpage directly without through a home-page click
- How can I redirect in React Router v6?
- Firebase-Admin, importing it to react application throws Module not found error
- ReactJS Bootstrap Navbar and Routing not working together