React. Basic example of re-rendering using react-router. +100 rep
问题 I'm newbie. And I'm newbie at React . I'm trying react-router . I saw this example: https://reacttraining.com/react-router/web/example/basic. I reproduced it on Codesandbox.io here: https://codesandbox.io/s/7jxq0j6qp0 I don't understand why the Menu is re-rendering itself when I change URL using menu's links. If you open console you can see it. Why? I think it should not re-render itself. Just the route section. Where am I wrong? 回答1: You can write your component as PureComponent. Since there