How can I go back to native view controller from react-native page?

爷,独闯天下 提交于 2021-01-27 15:12:44

问题


I wrapped a react-native page with a UIViewController, and pushed it with a navigation controller, but how can I pop to the native page using the react-native js code?


回答1:


The simplest way would be to have a property that references your UIViewController on your AppDelegate and have a React Native Module method (RCT_EXPORT) that calls dismissViewController or presentViewController, based on your situation.

I would recommend reading this post discussing combining native iOS Views and React Native here: Leverage Existing iOS Views with React Native



来源:https://stackoverflow.com/questions/30626301/how-can-i-go-back-to-native-view-controller-from-react-native-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!