react react-router code example Example 1: router react npm install react-router-dom Example 2: react-router $ npm install --save react-router