選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

README.md 1.3 KiB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # react-router
  2. Declarative routing for [React](https://facebook.github.io/react).
  3. ## Installation
  4. Using [npm](https://www.npmjs.com/):
  5. $ npm install --save react-router
  6. **Note:** This package provides the core routing functionality for React Router, but you might not want to install it directly. If you are writing an application that will run in the browser, you should instead install `react-router-dom`. Similarly, if you are writing a React Native application, you should instead install `react-router-native`. Both of those will install `react-router` as a dependency.
  7. Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
  8. ```js
  9. // using ES6 modules
  10. import { Router, Route, Switch } from 'react-router'
  11. // using CommonJS modules
  12. var Router = require('react-router').Router
  13. var Route = require('react-router').Route
  14. var Switch = require('react-router').Switch
  15. ```
  16. The UMD build is also available on [unpkg](https://unpkg.com):
  17. ```html
  18. <script src="https://unpkg.com/react-router/umd/react-router.min.js"></script>
  19. ```
  20. You can find the library on `window.ReactRouter`.
  21. ## Issues
  22. If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues).
  23. ## Credits
  24. React Router is built and maintained by [React Training](https://reacttraining.com).