3 ms·
One reason to go with components over a switch statement is so you can render a specific component on all '/about' pages along with an additional specific compo
by bostonvaulter2 10y ago
One reason to go with components over a switch statement is so you can render a specific component on all '/about' pages along with an additional specific component on all '/about/team' pages. With a switch statement you can only match a specific branch.
- kfinley 10y agoYou can still do nesting within a case, or add another case 'about-team': and add another {var} to your component. That's essentially what RR would do. React Router approach is probably a little cleaner, however.