You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will bootstrap a new plugin inside a folder named `my-plugin` accordingly. Inside that folder the commands
14
-
mentioned hereafter are available.
18
+
This will bootstrap a new plugin inside a folder named `react-native-my-plugin` accordingly. Inside that folder the commands mentioned hereafter are available. The prefix `react-native-` is optional and will be removed where the React Native context is implied.
15
19
16
-
Start working on your plugin by editing `/src/index.js` which will be the entry point for the plugin.
20
+
Start working on your plugin by editing `src/index.js` which will be the entry point for the plugin.
17
21
18
22
## App
19
23
20
-
Since you probably don't want to blind-code the whole plugin use the following command to generate an up-to-date
21
-
React Native app which includes the plugin:
24
+
Since you probably don't want to blind-code the whole plugin use the following command to generate an up-to-date React Native app which includes the plugin:
22
25
23
26
```
24
27
npm run app
25
28
```
26
29
27
-
This will create an app inside `/app` where except `/app/App.js` all files are gitignored. Here you can try out various
28
-
use cases of the plugin and use this as a way to demonstrate the plugin.
30
+
This will create an app inside `/app` where except `/app/App.js` all files are gitignored. Here you can try out various use cases of the plugin and use this as a way to demonstrate the plugin.
29
31
30
32
```
31
33
npm run watch
32
34
```
33
35
34
-
Running the above will watch the plugin `/src/` folder for any kind of changes and copy them over to the app which will
35
-
then automatically hot-reload.
36
+
Running the above will watch the plugin `/src/` folder for any kind of changes and copy them over to the app which will then automatically hot-reload.
36
37
37
-
Don't forget to always check your plugin both on Android and iOS even though your not using native code the provided components
38
-
might still differ depending on the platform.
38
+
Don't forget to always check your plugin both on Android and iOS even though your not using native code the provided components might still differ depending on the platform.
39
39
40
40
## Tests
41
41
42
-
The template is configured to work with Jest out of the box. All non-native functionality can be tested from the terminal.
43
-
With the following command you can run the tests which are found in a folder with the same name:
42
+
The template is configured to work with Jest out of the box. All non-native functionality can be tested from the terminal. With the following command you can run the tests which are found in a folder with the same name:
44
43
45
44
```
46
45
npm test
47
46
```
48
47
49
48
## Types
50
49
51
-
Since React Native will usually run in a modern JavaScript engine there is no need to transpile your source code and
52
-
apps can directly use the plugin source code. The Flow type checker is the default type system for react native and the
53
-
source code is writting in flow. While TypeScript is the more popular type checker overall flow is more popular in the
54
-
React Native ecosystem and can be used out of the box. Therefore this package will only support flow.
50
+
Since React Native will usually run in a modern JavaScript engine there is no need to transpile your source code and apps can directly use the plugin source code. The Flow type checker is the default type system for react native and the source code is writting in flow. While TypeScript is the more popular type checker overall flow is more popular in the React Native ecosystem and can be used out of the box. Therefore this package will only support flow.
51
+
52
+
## Troubleshooting
55
53
56
-
## Naming
54
+
If you have issues building the app for iOS try the following
57
55
58
-
React Native plugins are usually distributed through npm just as any other kind of browser and node plugins. To better distinguish
59
-
the plugin from a browser or node plugin the prefix `react-native-whatever-plugin` is usually added.
56
+
- Update XCode in the App Store (installation takes time)
57
+
- Update Cocoapods with `sudo gem install cocoapods`
58
+
- Update Pod dependencies in `app/ios` folder with `pod update`
60
59
61
60
## Examples
62
61
63
62
The following plugins have been created with create-react-native-plugin as a starting point.
0 commit comments