React Navigation
文章平均质量分 61
Anita-Sun
一只热衷于分享前端知识的奶牛猫~ ️
展开
-
使用react-navigation
安装 yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view @react-navigation/stack @react-navigation/native 代码 创建router/nav.jsimport React from 'react'; import原创 2021-03-31 09:01:34 · 209 阅读 · 0 评论 -
navigationHelper.js
import { CommonActions, StackActions } from '@react-navigation/native'; let NAVIGATION_HELPER_BLOBAL_NAME = 'NavigationHelper'; export default class navigationHelper { static navigation = null; static canTouch() { // 在最下边设置有 navigationHelper.CAN原创 2021-03-28 16:25:10 · 119 阅读 · 0 评论 -
React Navigation中StackActions reference
StackActions 方法详解: replace StackActions.replace('Profile', { user: 'Wojtek' }) 默认替换栈顶元素 push StackActions.push('Profile', { user: 'Wojtek' }) pop 里面的参数是你希望多少screen出栈 StackActions.pop(1) popToTop StackActions.popToTop() 代码: import * as React from 'reac原创 2021-03-31 08:35:37 · 491 阅读 · 0 评论 -
@react-navigation/native 中 CommonAction的使用
代码: import * as React from 'react'; import {View, Button, Text} from 'react-native'; import {NavigationContainer, CommonActions} from '@react-navigation/native'; import {createStackNavigator} from '@react-navigation/stack'; function HomeScreen({navigation原创 2021-03-31 00:07:21 · 854 阅读 · 0 评论