Skip to content

Commit 4f137ce

Browse files
committed
chore: docs and jest config
1 parent 3b7b371 commit 4f137ce

6 files changed

Lines changed: 40 additions & 17 deletions

File tree

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ docs/build/
55
docs/public/
66
docs/static/
77
web-build/
8-
testSetup.js
8+
jest/testSetup.js
99
__fixtures__/
1010

1111
# generated by bob
Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,60 @@
22
title: Getting Started
33
---
44

5+
import TabItem from '@theme/TabItem';
6+
import Tabs from '@theme/Tabs';
7+
58
# Getting Started
69

710
## Installation
811

9-
- Open a Terminal in your project's folder and run:
12+
Open a Terminal in your project's folder and install the library:
13+
14+
<Tabs groupId="expo-vs-cli">
15+
<TabItem value="expo" label="Expo" default>
16+
17+
```bash
18+
npx expo install react-native-paper
19+
```
20+
21+
</TabItem>
22+
<TabItem value="community-cli" label="Community CLI">
1023

1124
```bash npm2yarn
1225
npm install react-native-paper
1326
```
1427

15-
- From `v5` there is a need to install [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe area.
28+
</TabItem>
29+
</Tabs>
1630

17-
```bash npm2yarn
18-
npm install react-native-safe-area-context
31+
React Native Paper uses [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe area, [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/) and [react-native-worklets](https://docs.swmansion.com/react-native-worklets/) for animations.
32+
33+
<Tabs groupId="expo-vs-cli">
34+
<TabItem value="expo" label="Expo" default>
35+
36+
```bash
37+
npx expo install react-native-safe-area-context react-native-reanimated react-native-worklets
1938
```
2039

21-
- You also need to install [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/) and [react-native-worklets](https://docs.swmansion.com/react-native-worklets/) for animations.
40+
</TabItem>
41+
<TabItem value="community-cli" label="Community CLI">
2242

2343
```bash npm2yarn
24-
npm install react-native-reanimated react-native-worklets
44+
npm install react-native-safe-area-context react-native-reanimated react-native-worklets
2545
```
2646

27-
- Follow the [React Native Reanimated installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/) for your toolchain (Expo vs React Native Community CLI). **Community CLI** setups must add `'react-native-worklets/plugin'` **last** in your `babel.config.js` `plugins` array. **Expo** setups follow that guide’s Expo steps (install packages and rebuild native code); starter templates [since Expo SDK 50](https://expo.dev/changelog/2024/01-18-sdk-50) usually include the Worklets Babel plugin already—add it only if your `babel.config.js` does not. Paper declares **minimum** supported versions for `react-native-reanimated` and `react-native-worklets` under `peerDependencies` in [`package.json`](https://github.com/callstack/react-native-paper/blob/main/package.json) (`>=` ranges, not pinned versions). When troubleshooting animation or native build problems, confirm your installed packages meet those minimums.
47+
</TabItem>
48+
</Tabs>
2849

29-
Additionaly for `iOS` platform there is a requirement to link the native parts of the library:
50+
Follow the [React Native Reanimated installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/).
3051

31-
```bash
32-
npx pod-install
33-
```
52+
Minimum requirements:
53+
54+
- `react-native-reanimated` **≥ 4.3.0**
55+
- `react-native-worklets` **≥ 0.8.1**
56+
- `react-native-safe-area-context` — version compatible with your React Native toolchain.
3457

35-
- If you're on a vanilla React Native project, you also need to install and link [@react-native-vector-icons/material-design-icons](https://github.com/oblador/react-native-vector-icons).
58+
If you're on a vanilla React Native project, you also need to install and link [@react-native-vector-icons/material-design-icons](https://github.com/oblador/react-native-vector-icons).
3659

3760
Specifically `MaterialDesignIcons` icon pack needs to be included in the project, because some components use those internally (e.g. `AppBar.BackAction` on Android).
3861

docs/docs/guides/03-icons.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import IconsList from '@site/src/components/IconsList.tsx';
1010

1111
## Configuring icons
1212

13-
Many of the components require the [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) library to render correctly. If you're using Expo, you don't need to do anything extra, but if it's a vanilla React Native project, you need to link the library as described in the [getting started guide](./01-getting-started.md).
13+
Many of the components require the [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) library to render correctly. If you're using Expo, you don't need to do anything extra, but if it's a vanilla React Native project, you need to link the library as described in the [getting started guide](./01-getting-started.mdx).
1414

1515
:::note
1616
If you opted out of vector icons support using [babel-plugin-optional-require](https://github.com/satya164/babel-plugin-optional-require), you won't be able to use icon names for the icon prop. Some components may not look correct without vector icons and might need extra configuration.

testSetup.js renamed to jest/testSetup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ jest.mock('react-native/Libraries/Utilities/BackHandler', () => {
132132
},
133133
},
134134
};
135-
});
135+
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@
120120
"jest": {
121121
"preset": "react-native",
122122
"setupFiles": [
123-
"<rootDir>/testSetup.js"
123+
"<rootDir>/jest/testSetup.js"
124124
],
125125
"setupFilesAfterEnv": [
126-
"<rootDir>/jestSetupAfterEnv.js",
126+
"<rootDir>/jest/jestSetupAfterEnv.js",
127127
"@testing-library/jest-native/extend-expect"
128128
],
129129
"cacheDirectory": "./cache/jest",

0 commit comments

Comments
 (0)