React Native中Navigator的安装与使用
一、安装Navigator
1.安装react-native-deprecated-custom-components
2.若npm安装报错,则执行下面命令
3.若还未解决则使用yarn命令(前提是自己有yarn的配置环境)
二、使用Navigator
说明:本demo为男生给女生送一枝玫瑰,女生回赠巧克力。包含了父子组件的通信
1.引入Navigator
2.页面A(用于放置父组件Boy和子组件Girl):
3.父组件Boy(父组件):
4.子组件Girl(子组件):