Instawork / hyperview

Server-driven mobile apps with React Native
https://hyperview.org
MIT License
1.23k stars 58 forks source link

Using react-navigation native header for screens #529

Open rtpm opened 1 year ago

rtpm commented 1 year ago

Can native navigation header be used with hyperview?

In the demo app, a native navigator is hidden, and every screen returns it's own header instead of modifying the title of the native one. This means there are no iOS swipe left to right navigation and native look available.

Thanks

adamstep commented 1 year ago

@rtpm Technically you can use any navigation implementation you want, as long as you support the callbacks described here: https://hyperview.org/docs/reference_hyperview_component (push(), back(), openModal(), closeModal(), etc).

The demo app is built using React Navigation which I believe does support title bars with transitions and swipe gestures. In fact the demo app supports left-to-right swipe, albeit without the title transitions you described. If you want to try using React Navigation's support for native headers, let me know and I can try to help.

adamstep commented 1 year ago

You may be interested in the work we are doing to expose navigation hierarchy through the Hyperview XML: https://github.com/Instawork/hyperview/commits/hardin/navigator-integration

This will enable native navigation to be used and controlled through the markup, without requiring custom JS logic.