File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ npm install preact
5858
5959## Usage
6060
61- 1 . Fix ` metro.config.js ` to use babelTransformer from this library.
61+ ### 1. Fix ` metro.config.js ` to use babelTransformer from this library.
62+
63+ #### React Native
6264
6365``` javascript
6466module .exports = {
@@ -77,7 +79,25 @@ module.exports = {
7779};
7880```
7981
80- 2 . Make entry file for web app.
82+ #### Expo
83+
84+ ``` javascript
85+ const { getDefaultConfig } = require (" expo/metro-config" );
86+
87+ const config = getDefaultConfig (__dirname );
88+
89+ module .exports = {
90+ ... config,
91+ transformer: {
92+ ... config .transformer ,
93+ babelTransformerPath: require .resolve (
94+ " react-native-react-bridge/lib/plugin"
95+ ),
96+ },
97+ };
98+ ```
99+
100+ ### 2. Make entry file for web app.
81101
82102- If you use React in web, import modules from ` react ` and ` react-native-react-bridge/lib/web ` .
83103- If you use Preact in web, import modules from ` preact ` and ` react-native-react-bridge/lib/web/preact ` .
@@ -126,7 +146,7 @@ const Root = () => {
126146export default webViewRender (< Root / > );
127147```
128148
129- 3 . Use the entry file in your React Native app with WebView.
149+ ### 3. Use the entry file in your React Native app with WebView.
130150
131151``` jsx
132152// App.js
@@ -160,7 +180,7 @@ const App = () => {
160180};
161181```
162182
163- 4 . Start your React Native app!
183+ ### 4. Start your React Native app!
164184
165185## Demo
166186
You can’t perform that action at this time.
0 commit comments