using router in reactjs code example Example 1: install react router $ npm install --save react-router Example 2: react route npm install react-router-dom