Is it good practice to store whole React Components in the component state or redux state? Yes, it's optional as we could store a string in the state and render the component conditionally but in some cases, it is simpler to just store the component in the state.
For example,
const [ components ] = useState([
{ id: 1, component: <Login />, title: `Login` },
{ id: 2, component: <Register />, title: `Register` },
])
But components can be large and I was wondering if that makes any difference. Is this a bad practice?
const components = [{ id: 1, component: Login, title: "Login" }, { id: 2, component: Register, title: "Register" }]
outside your component? – Zygote