DEV Community

loading...

Discussion on: WebView — Navigation and data flow with WebViews in a React Native app

Collapse
redbar0n profile image
Magne

What would you think about using this method to achieve a Hybrid-Native Sweet Spot: Native navigation with web content?

signalvnoise.com/posts/3743-hybrid...

It would allow you to make your webapp in whatever web framework you’d like, and swap it out whenever something better (like SolidJS) comes along. Clients would also get updates to the main webapp instantly. As opposed to users having to update their native app frequently, after the developer had to wait 14 days for App Store approval each time.

You could also completely avoid having an API client, merely serving HTML over the wire. See Hotwire.dev, where HOTwire Strada is similar to the JSON bridge you used to communicate between React Native and the WKWebView.

Doing that would allow you to SSR content even for the Native app. Giving more control to the server as to what is rendered, instead of using something like Server-Driven Rendering (like AirBnB etc.) which controls native components by using JSON commands from the server.

Not sure how good web animations would be, but allegedly they can run in 60fps inside the WKWebView.

This would also be superior to using CapacitorJS as a bridge between a webapp and native, since Capacitor requires you bundle and distribute everything (including updates) in the App Store.