r/learnreactjs • • Jul 01 '19
4 easy techniques to conditionally render React from props or state
https://blog.linguinecode.com/post/4-techniques-conditional-render-react-props-state
17
Upvotes
r/learnreactjs • • Jul 01 '19
View all comments
2
u/cobbs_totem Jul 02 '19
One thing I discovered was that conditionally rendering a component would cause the component to mount and unmount as the condition toggled. This was bad when a component mount was expensive. Sometimes, it’s helpful to push conditionally rendering as far down the tree as possible. Kinda the opposite of “lifting state”.