I have made one page in my project, it's App.tsx and it contains a lot of components. like this:
import React from 'react';
import './App.css';
import Header from './components/Header';
import Underline from './components/Underline';
import BodyPart from './components/BodyPart';
import Footer from './components/Footer';
import AboveFooter from './components/AboveFooter'
import Home from './Home';
import {createBrowserRouter, createRoutesFromElements, Route, Link, Outlet, RouterProvider, BrowserRouter, Routes} from 'react-router-dom'
function App() {
return (
<div>
<Header />
<Underline />
<BodyPart />
<AboveFooter />
<Footer />
</div>
);
}
export default App;
I also want to have another pages, and I want to click on a button that is inside of one of the components to transfer me to my next page:
<Link to="/home">
<button className='bg-purple-950 rounded-lg h-24 w-3/4 mt-32 ml-44
pt-auto flex justify-between py-1'>
<img src={glob} alt="" className='h-20 w-32 ml-2 mt-1' />
<div className='flex-col h-24 mt-2'>
<h1 className='font-bold text-2xl text-yellow-600'>Globaltel POSTPAID paketi uz telefone</h1>
<p className='font-bold text-2xl text-white'>u svim Gigatron prodavnicama!</p>
</div>
<img src={majstor} alt="" className='' />
<div className=' h-24 w-72 relative'>
<button className='h-10 w-32 rounded-full absolute right-1 bottom-3 bg-yellow-600 hover:bg-yellow-300'> Saznajte više</button>
</div>
</button>
</Link>
but I keep getting error: you cannot render a inside another . you should never have more than one in your app.
I have tried BrowserRoutes, only Route, Routes, createBrowserRouter, createRoutesFromElements, paths and elements and I just keep getting message or I am just clicking on a button and nothing happens