3 ms·
Although I am admittedly fairly green when it comes to using React (full disclosure, I use Flux to manage state), I am unsure as to why you would NEED or want t
by Rooster61 10y ago
Although I am admittedly fairly green when it comes to using React (full disclosure, I use Flux to manage state), I am unsure as to why you would NEED or want to handle conditional forks within the view itself.
My understanding of React was that conditions such as this should be handled by whatever is managing the state of the component, be it a method call within your view that alters your the local state, or a store based system such as Flux/Redux where the state is handled outside the view itself. Part of what makes React a beautiful framework (to me) is the concept of a state which controls what is rendered. Controlling what is rendered directly from the render method in the view seems to defeat one of the purposes of using a stately framework such as React in the first place. Sort of a cart-leading-the-horse situation.
Again, though, I am new to this framework (and JS frontend development in general) so please feel free to correct me.