React Native Navigation Locks User Interaction

169 views Asked by At

I am using RN 0.55 and RNN 2.1.2. When I am on the root screen of my stack navigator and swipe right (the back action) then attempt to navigate via a push, all user interaction locks and the application becomes unresponsive. It does not crash, nor does it throw an error. It just locks up. Has anyone experienced this or have a fix?

NOTE: There is a small chance that that .push is being called twice very very quickly. It isn't debounced and can be triggered multiple times.

The initial setup in index.js

Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      stack: {
        children: [
          {
            component: {
              name: "search.ListsOfThings",
              options: {
                layout: {
                  orientation: ['portrait']
                },
                topBar: {
                  visible: false,
                  drawBehind: true
                }
              }
            }
          }
        ]
      }
    }
  })
})

the push command inside of ListOfThings

Navigation.push(this.props.componentId, {
            component: {
              name: 'search.FoundThings',
              passProps: {
                things: data.foundThings
              },
              options: {
                layout: {
                  orientation: ['portrait']
                },
                topBar: {
                  visible: false,
                  drawBehind: true
                }
              }
            }
          })
1

There are 1 answers

0
DaemonS On

To lock you need to follow this:

stack: {
      children: [{.....}],
      options: { layout: { orientation: ['portrait']}}
    },

This should help