mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-11 08:13:29 +08:00
docs: fix instructions for expo (#271)
This commit is contained in:
committed by
Satyajit Sahoo
parent
316f3f53ca
commit
87349c112a
@@ -11,13 +11,28 @@ Open a Terminal in your project's folder and run,
|
||||
yarn add react-native-paper
|
||||
```
|
||||
|
||||
If you're on a vanilla React Native project, you also need to install and link [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons). If you use CRNA or Expo, you don't need this step.
|
||||
If you're on a vanilla React Native project, you also need to install and link [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons).
|
||||
|
||||
```sh
|
||||
yarn add react-native-vector-icons
|
||||
react-native link react-native-vector-icons
|
||||
```
|
||||
|
||||
If you use CRNA or Expo, you don't need this step, but you will need to install `babel-preset-expo` as a dev dependency and add it to the `.babelrc` config:
|
||||
|
||||
```sh
|
||||
yarn add -D babel-preset-expo
|
||||
```
|
||||
|
||||
**.babelrc**
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
"expo"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Wrap your root component in `Provider` from `react-native-paper`. If you have a vanilla React Native project, it's a good idea to add it in the component which is passed to `AppRegistry.registerComponent`. This will usually be in the `index.js` file. If you have a CRNA or Expo project, you can do this inside the exported component in the `App.js` file.
|
||||
|
||||
Reference in New Issue
Block a user