How to use React’s new Context API to easily manage modals

  • component: the modal component that we want to render
  • props: the props that we want to set on the modal component
  • showModal: a function that will show the modal
  • hideModal: a function that will hide the modal

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bogdan Soare

Bogdan Soare

I develop experiences on the mobile and web