mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-21 05:20:19 +08:00
19 lines
475 B
Markdown
19 lines
475 B
Markdown
---
|
|
id: installing-a-dependency
|
|
title: Installing a Dependency
|
|
---
|
|
|
|
The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`:
|
|
|
|
```sh
|
|
npm install --save react-router-dom
|
|
```
|
|
|
|
Alternatively you may use `yarn`:
|
|
|
|
```sh
|
|
yarn add react-router-dom
|
|
```
|
|
|
|
This works for any library, not just `react-router-dom`.
|