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
- Create React app bundle for WebView automatically in build process of React Native
22
+
-`.js`, `.ts`, `.jsx`, `.tsx` will be packed into one source.
23
+
- Handle communication between React Native and WebView with React hook style
24
+
- Support bundling some assets in web side with ES6 import syntax
25
+
-`.json` is imported as an object, like require in Node.js.
26
+
-`.css` is injected to the HTML head of WebView, like [css-loader](https://github.com/webpack-contrib/css-loader).
27
+
-`.bmp`, `.gif`, `.png`, `.jpg`, `.jpeg`, `.webp` and `.svg` are loaded as base64 encoded url, like [url-loader](https://github.com/webpack-contrib/url-loader).
28
+
29
+
If you have some feature requests or improvements, please create a [issue](https://github.com/inokawa/react-native-react-bridge/issues) or [PR](https://github.com/inokawa/react-native-react-bridge/pulls).
30
+
19
31
## Install
20
32
21
33
```sh
@@ -56,8 +68,10 @@ import {
56
68
emit,
57
69
useSubscribe,
58
70
} from"react-native-react-bridge/lib/web";
59
-
//Import css is supported
71
+
//Importing css is supported
60
72
import"./example.css";
73
+
// Images are loaded as base64 encoded string
74
+
importimagefrom"./foo.png";
61
75
62
76
constRoot= () => {
63
77
const [data, setData] =useState("");
@@ -69,6 +83,7 @@ const Root = () => {
69
83
});
70
84
return (
71
85
<div>
86
+
<img src={image} />
72
87
<div>{data}</div>
73
88
<button
74
89
onClick={() => {
@@ -123,11 +138,6 @@ const App = () => {
123
138
124
139
4. Start your React Native app!
125
140
126
-
## Limitations
127
-
128
-
- In web side, `.js`, `.ts`, `.jsx`, `.tsx`, `.css` and `.json` are currently supported extensions.
129
-
- If you have some feature requests or improvements, please create a [issue](https://github.com/inokawa/react-native-react-bridge/issues).
0 commit comments