Open Dev Menu or reload app without shaking?

后端 未结 7 722
终归单人心
终归单人心 2021-02-07 10:25

Is there a way to open dev menu or reload app without shaking the app?

Android Wireless over wifi so no usb cable Windows 10

Hot reload or Live reload is not goo

7条回答
  •  太阳男子
    2021-02-07 10:42

    For iOS I like to wrap my app in a component like this which allows a 3 finger touch to trigger the dev menu:

    import { NativeModules } from 'react-native';
    
    // wraps the app in a function to allow three finger dev menu access
    const DevMenuTrigger = ({ children }) => {
      const { DevMenu } = NativeModules;
      const panResponder = PanResponder.create({
        onStartShouldSetPanResponder: (evt, gestureState) => {
          if (gestureState.numberActiveTouches === 3) {
            DevMenu.show();
          }
        },
      });
      return {children};
    };
    
    const DevApp = () => ();
    
    // export default App;
    export default DevApp;
    

提交回复
热议问题