DEV Community

Discussion on: How to Dynamically Render Components in React

Collapse
 
andyrewlee profile image
Andrew Lee

Good catch! Just noticed the typo in my componentMapping. Before it was something like

const componentMapping = {
  Navbar1: <Navbar1 />
}

I just changed it to this so we render in the map callback.

const componentMapping = {
  Navbar1
}
Collapse
 
devhammed profile image
Hammed Oyedele

Oh...I get it now.
😁😁😁