


Once you have webpack configured and the necessary dependencies installed, somewhere in your code (probably towards the root of your React component tree) you can import the modules you need from react-router-dom.
React script unpkg how to#
Because webpack is a low-level tool that allows you to fine-tune your build to your liking, you may want to read the webpack documentation or check out webpack configurations in other repos to understand how to build your own. Setting up a new React project in webpack is a bit more involved than Parcel or Create React App. Click the "About" link to see your About route, and voilà! You successfully set up React Router using Parcel! 🥳 Webpackįollow the instructions in the webpack documentation to set up a new project, then follow the installation instructions above to install React Router in your project. Now start your app by running npm start, and you should see the Home route when your app starts running. App.js import * as React from " react" In your project's package.json, add a start script so you can open your project in a browser during development. Parcelįollow the instructions in the Parcel documentation to set up a new project, then follow the installation instructions above to install React Router in your project. When it's time to deploy your app to production, be sure to follow Create React App's instructions on deploying with React Router to be sure your server is configured correctly. Click the "About" link to see your route, and voilà! You've successfully set up React Router using Create React App! 🥳 Go ahead and start your app by running npm start, and you should see the Home route when your app starts running. That feels like an existential question, don't you
