Untitled
unknown
javascript
a year ago
749 B
5
Indexable
import Home from "./pages/home"
function App() {
return (
<>
<BrowserRouter>
<Routes>
<Route path="/" element={<Home/>}/>
</Routes>
</BrowserRouter>
</>
);
import React from "react";
const Home = () => {
const redirectFunc = () => {
window.onload = "/detail";
};
return (
<div>
<button onClick={redirectFunc}>Detaya git</button>
</div>
);
};
export default Home;
import React from "react";
const Detail = () => {
const redirectFunc = () => {
window.onload = "/";
};
return (
<div>
<button onClick={redirectFunc}>Anasayfaya dön</button>
</div>
);
};
export default Detail;
Editor is loading...
Leave a Comment