S
S
Suleimanov_Ismar2022-01-15 22:08:19
JavaScript
Suleimanov_Ismar, 2022-01-15 22:08:19

React Route (render, children) not working why?

Hello.

For some reason, the react route does not want to work, namely render, children.
I look at everything from the documentation, but it does not plow.
Please tell me what is the problem?

render(){
  return (
    <Router>
      <Routes>
        <Route exact path="/users" render={() => <div>Home</div>}/>
      </Routes>
    </Router>
  )
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexandroppolus, 2022-01-16
@Suleimanov_Ismar

What version of the router? In 6 there is no render prop, there is an element

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question