My journey into the React Portal

Brandon Conway
Jun 5, 2019 · 4 min read

I recently needed to render a flash message elsewhere in a React app. As far as I could tell, I had three choices:

  1. Use Redux and a connected component to render the flash message.
  2. Use Context, which is easier than ever to use thanks to the awesome useContext hook.
  3. Use something I saw in the React docs a while ago called a Portal.