DEV Community

Discussion on: How to get React Router 4 to allow nested components inside of a Switch

Collapse
 
jacobsfletch profile image
Jacob Fletcher

I signed up for dev.to only so that I could like this post and send this comment. I needed to map over an array and return a set of routes which does not work because of the nested Fragment within the Switch. This is a verified workaround. Thank you greatly for taking the time to write this up!

Collapse
 
tylerlwsmith profile image
Tyler Smith

Thank you for the kind words! I'm glad you found it useful: this problem had me completely stumped for hours.