Skip to content

Modal not work on Android when using State to hide it in try/catch section #10417

Closed
@raminious

Description

@raminious

Issue Description

Modal component not worked on android when changing state to hide it in try/catch section

Steps to Reproduce / Code Snippets

makeReauest = () => {
  this.setState({ loading: true })
  Media.request(url)
  .then(response => {
    // todo
  }, e => {
    this.setState({ loading: false })
  })
}

render() {
  return(
    <View>
      <Modal
          animationType={'slide'}
          transparent={false}
          visible={this.state.loading}
          onRequestClose={() => {} }
       >
        <View></View>
      </Modal>
      <Text onPress={this.makeRequest}>Do Magic</Text>
    </View>
  )
}

Result

image

Additional Information

  • React Native version: 0.35.0
  • Platform: just Android
  • Android Version: 5.1.0 on Google Nexus 6 (Genymotion Simulator)
  • Operating System: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions