I have the following code in react js
const routing = (
<Router>
<div>
<Route path="/posts" component={Posts} />
<Route path="/posts/new" component={New} />
</div>
</Router>
)
ReactDOM.render(routing, document.getElementById('root'))
when I try to write localhost/posts or localhost/posts/new , the same components called . I know that this behaviour occurred because I have "posts" in both routes . any solution for my problem , I need "posts" in both routes