Building a Reusable Modal Component With Dynamic Content in React

Natalie Mclaren
The Startup
Published in
7 min readOct 1, 2020

--

With react-bootstrap and useReducer()

Photo by Halacious on Unsplash

I recently came across the use case for a modal in one of my personal projects — the usual ‘are you sure you want to block X user?’ I installed my package of choice, added an out of the box modal with the desired content and surely enough, I had a modal. The problem is that this wasn’t the only use case I would need…

--

--