3D_portfolio
3D_portfolio copied to clipboard
At 18:05, I am not getting the same output
After adding the routes, Its not showing the string on the localhost. Help will be appreciated!
didi you install https://v5.reactrouter.com/web/guides/quick-start npm install react-router-dom
Replace element={'Home'}
with element={<Home />}
and repeat this process (changing single quotation with a self closing tag for including those components in the Route) and then you're good to go! 😉
I am having the same issue and that did not work.
@srp8 If you're having the exact same issue with exact same code as the questioner, then by replacing those codes I've mentioned, it has to solve your issue. Otherwise, your problem is related to other sections of your application and you need to check the console for further information.
React Router Integration
Code Example
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom';
import Navbar from './Components/Navbar';
import { Home, About, Projects, Contact } from './pages';
const App = () => {
return (
<main className='bg-slate-300/20'>
<Router>
<Navbar/>
<Routes>
<Route path='/' element={<Home/>} />
<Route path='/about' element={<About/>} />
<Route path='/projects' element={<Projects/>} />
<Route path='/contact' element={<Contact/>} />
</Routes>
</Router>
</main>
);
};
export default App;
@adarsaparasar
{<Home/>} />
Give a space after "Home" and see if it fixes your issue. Like this:
{<Home />} />