React Native for Web implementation of RN’s WebView
$ npm install react-native-web-webview --save
Alias the package in your webpack config:
resolve: {
alias: {
'react-native': 'react-native-web',
...
'WebView': 'react-native-web-webview',
}
}
Add the following rule to your webpack config:
const rule = {
test: /postMock.html$/,
use: {
loader: 'file-loader',
options: {
name: '[name].[ext]',
},
},
};
import WebView from 'WebView'; // don't import from react-native
See RN’s doc.
Supported props are:
See the storybook.
PRs are welcome!