React Core community and learning. Author: http://abookapart.com/products/animation-at-work GDE—Formerly W3C, MSFT. Currently INFJ, single, and doodling!
Nice write up! To clarify, the only way to trigger a render is to use the state setting function (ie setState()). If you update the state variable any other way, it not only won't trigger a rerender, but if something ELSE triggers that rerender, if your variable is a primitive like boolean, number or string, you'll lose your changes with the rerender!💜
Nice write up! To clarify, the only way to trigger a render is to use the state setting function (ie
setState()
). If you update the state variable any other way, it not only won't trigger a rerender, but if something ELSE triggers that rerender, if your variable is a primitive like boolean, number or string, you'll lose your changes with the rerender!💜Yes, totally forgot that. Thanks for reminding me. I'll edit the article. 😄