O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Looking at modals

Modals let us present content over another view. In React Native, we can render one using the Modal tag. Any child elements within a Modal tag are rendered within it.

Modals have a couple of props that we can take advantage of. The ones listed as follows will be used in this project, though there are more available in the React Native documentation:

  • animationType: This controls how a modal animates when it appears for the user. The three options are slide (from bottom), fade, and none.
  • onRequestClose: This is a callback that is fired when a modal is dismissed.
  • transparent: This is a Boolean that determines modal transparency.
  • visible: This is a Boolean to determine whether a modal is visible.

Since this modal will encapsulate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required