String to Component in React
Map a string to a component: const MAP = { hello: Hello, bye: Bye }; const Comp = MAP[kind] || Fallback; return <Comp />. Don’t eval(). Don’t dangerouslySetInnerHTML untrusted HTML. That’s how widget builders stay safe.
String to Component in React — kind=bye → Bye. A dictionary of components is the safe pattern.
Parent
│ props (read-only)
▼
Child → UIExam tip
String → component map. Never eval.