0

I have one class component called addContact, on clicking of button I want to redirect to contact list component, I am using v6 router, how to programmatically redirect similar to useHistory hook used in functional component

<div className="App">
      <BrowserRouter>
        <>
      <Header></Header>
      <Routes>
      
        <Route path="/"  element={<ContactList contacts={contacts} deleteContact={removeHandler} />}>
      </Route>
      <Route path="/add" exact element={<AddContact addContact={addContact} />}>
      </Route>
      
      
     
      </Routes>
      </>
     
      </BrowserRouter>
     
    </div>
Drew Reese
  • 103,803
  • 12
  • 69
  • 96
divya dave
  • 451
  • 1
  • 8
  • 20
  • Does this answer your question? [Problem in redirecting programmatically to a route in react router v6](https://stackoverflow.com/questions/69899955/problem-in-redirecting-programmatically-to-a-route-in-react-router-v6) – Drew Reese Dec 09 '21 at 16:26

0 Answers0