Is there any interest in this? In its simplest form, the web version can use alert().
We shouldn't introduce use of APIs like alert or prompt, which means this would need to be built from scratch. We don't currently have a need for this API at Twitter; no intent to bring this API to Web at the moment.
@necolas so you'd like a View component that will be displayed over the application?
@necolas @jsierles The problem here, is that, the only solution to make this work with something different from browser alert api, is to introduce an Alert layer in top of all react-native-web application. render of ReactNativeApp should look like:
return (
<View style={styles.appContainer}>
<RootComponent {...initialProps} rootTag={rootTag} />
<Alert.View />
</View>
);
thoughts?
Implemented with https://github.com/necolas/react-native-web/pull/305
Does anyone know of any other ways that we can polyfill React Native's Alert API on the web? Looking for something to hold me over until #305 gets merged, since that PR has been sitting stale for awhile. Thanks!
@joncursi You can ref my pr as dependency in package.json.
"react-native-web": "git+https://github.com/vaukalak/react-native-web.git#cbde40dc803d18f029c1c1352e2a925805ca0823",
Then on postinstall I run following script:
#fix react-native-web
pushd node_modules/react-native-web
yarn && npm run compile
rm -rf types
rm -rf docs
rm -rf benchmarks
rm -rf node_modules
rm -rf .github
rm .eslintrc
rm .flowconfig
rm .gitignore
rm webpack.config.js
rm core.js
rm yarn.lock
rm .travis.yml
popd
Any updates on when the PR will be merged?
Most helpful comment
Implemented with https://github.com/necolas/react-native-web/pull/305