Let's say I have a constant in a file.
//routes.ts
export const routes = [
{path: "/", component: component1 },
{path: "/two", component: component2 }
]
If I then import this const in any react component, does it import all the components too?
This wouldn't be a problem if I just use it for mapping the routes. But in some other components I need the array only for the path property. If I import the const in those components, will it add the component imports from routes.ts in those components as well? Should this be a performance issue?