I want to make to render children in father component with React Router Dom v6.2.2, that's how I tried to make it but browser shows nothing eventually:
const MainLayout = props => {
return (
<div className='main-layout'>
<Header />
<div className='main'>
{props.children}
</div>
</div>
)
}
App.js:
function App() {
return (
<div className="App">
<BrowserRouter>
<Routes>
<Route exact path="/" render={() => (
<MainLayout>
<Homepage />
</MainLayout>
)} />
</Routes>
</BrowserRouter>