Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
493 views
in Technique[技术] by (71.8m points)

Screen freeze when navigate in react native navigation with Drawer navigation

I have an issue with Drawer navigation in React Native Navigation.

The problem seems to be very simple.

I have 2 screens, on each screen I have a button that sends the user to the other one.

the problem is after sending the user from screen A to B and from B to A the button does not work anymore.

I can pull the drawer and go back to the B screen again, and the Button works there, but the button in the A screen is still frozen, the hole screen basically.

import React from "react";
import { createDrawerNavigator } from "@react-navigation/drawer";

import SettingScreen from "../screens/SettingScreen";
import ProfileScreen from "../screens/ProfileScreen";

const Drawer = createDrawerNavigator();

function MenuNavigation(props) {
  return (
    <Drawer.Navigator>
      <Drawer.Screen name="Setting" component={SettingScreen} />
      <Drawer.Screen name="Profile" component={ProfileScreen} />
    </Drawer.Navigator>
  );
}

export default MenuNavigation;
question from:https://stackoverflow.com/questions/65854555/screen-freeze-when-navigate-in-react-native-navigation-with-drawer-navigation

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Seems like the newest version 5.12.2 of @react-navigation/drawer has this issue. So I tried with an older version 5.11.5 and it worked for me. I tested on an adroid mobile only though.

Command to install a specific npm packager version is:
yarn add @react-navigation/[email protected]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...