rotas react com axios code example

Example 1: rotas react com axios

import React from 'react';
import Header from '../Header';
 
function Form(){
    return (
        <div>
            <Header title="React Form" />
            Olá Mundo!
        </div>
    )
}
 
export default Form;

Example 2: rotas react com axios

function App() {
  return (
    <Routes />
  )
}

Example 3: rotas react com axios

import React from 'react';
import {Route, BrowserRouter} from 'react-router-dom';
 
import Home from './Pages/Home';
import Form from './Pages/Form';
 
function Routes(){
    return (
        <BrowserRouter>
            <Route component={Home} path="/" exact />
            <Route component={Form} path="/cadastro" />
        </BrowserRouter>
    )
}
 
export default Routes;