It`s my first React project and i want to make a multi page app for my BackEnd API, but none of my pages appear on the Screen
App.jsx
import React from 'react';
import { HashRouter as Router, Routes, Route } from 'react-router-dom';
import Login from './pages/Login';
import Main from './pages/Panel';
export default function App() {
return (
<Router>
<Routes>
<Route path="/" element={<Login />} />
<Route path="/app" element={<Main />} />
</Routes>
</Router>
);
}
pages/Login.jsx
import React from 'react';
export function Login() {
return(
<>
<h1>Login Screen</h1>
<h2>Start</h2>
<p>AAAAAAAAAAAAAAAAAAAAaa</p>
<p>Test</p>
</>
)
}
main.jsx
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
My friend try to solve this and in his computer its working fine but when i got the commit he made still doesn’t change anything, i am using Vite and this is the only parts of the code that i modify expect the css files and the another page i try to make work out
Dilker Winter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.