Serve HTML page and execute its included Javascript in React Native app
Serve HTML page and execute its included Javascript in React Native app
I'm working on a React Native application using react-native-maps. Part of this app requires a draggable geofence. Unfortunately, react-native-maps
does not include this. However, the actual Google Maps Javascript API does. It even seems possible to allow the user to resize the polygon, which is my ultimate goal.
react-native-maps
Is there a way to serve a static HTML page as part of a React application in a way that would allow seamless navigation between it and the React components and correctly execute the Javascript in the static HTML page (see the Google Maps API example linked above)?
1 Answer
1
You can use a Webview to serve a static HTML. Not sure how well it handles javascript though
https://facebook.github.io/react-native/docs/webview
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
That renders an empty page. It appears the HTML loads, but the script does not execute.
– 223seneca
Aug 23 at 19:33