Thanks for sharing! I'm actually in the midst of creating a similar article about React.Portal for a modal I recently created so your post was very insightful! One thing I noticed with React.Portal is that the div id="portal" always seems to exist in the DOM which slightly bothered me. I've been tinkering around with appending the div to the body on componentDidMount of Modal component-- not sure if that's considered bad practice but I'm having fun trying it out. Hopefully I'll have more to share soon after some experimentation :)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.