Turn off Push Animation When Use React Native Navigation V2

Viewed 2654

How to turn off animation when do Navigation.push when use RNN v2?

Tried set animated: false when use V1 did. But not work on V2

Navigation.push(this.props.homeId, {
  component: {
    name: 'Screen2',
    animated: false,
    options: {
      animated: false,
      topBar: {
        title: {
          text: 'Pushed Screen Title'
        }
      }
    }
  }
})

}

Read the V2 doc, but didn't find anything helpful.

1 Answers

According to the Styling documentation, for pushing and popping screens to and from a stack, you can disable animations separately which seems to satisfy your need.

Navigation.push(this.props.componentId, {
  component: {
    name: 'Screen2',
    options: {
      topBar: {
        title: {
          text: 'Pushed Screen Title'
        }
      },
      animations: {
        push: {
          enabled: false
        }
      }
    }
  }
})
Related