React.js — return null vs display: none?

Which is faster in performance to conceal the element return null or display : none?
June 27th 19 at 15:18
1 answer
June 27th 19 at 15:20
Solution
I think return null make changes to the DOM, or to be more precise, it deletes an item, while setting CSS properties or add a CSS class hide with CSS property display : none will hide faster element, because there is no need to change the DOM.

It's my guess, and I'll go look for the proof/refutation of my conjecture.
I read on one eng. the forum, which is faster return null here, I wanted to clarify. - britney38 commented on June 27th 19 at 15:23
: a reference can be - Dianna.Harris commented on June 27th 19 at 15:26
: https://discuss.reactjs.org/t/conditional-renderin... - britney38 commented on June 27th 19 at 15:29
: There is given a clear answer if you need to show and hide, the better the classroom setting, but otherwise, if the element is initially hidden, then null - jamie_Gra commented on June 27th 19 at 15:32

Find more questions by tags React