Closed finkef closed 1 week ago
I just had another thought. You might also be able to the context view state as a local variable with useSelector
, and then add that variable to the useEffect
hook that is already in place to call updateSize
. Then you wouldn't need rAF.
I just had another thought. You might also be able to the context view state as a local variable with
useSelector
, and then add that variable to theuseEffect
hook that is already in place to callupdateSize
. Then you wouldn't need rAF.
You're right, that works well in this case and removes the need for the delayed function version. Updated. 👍
Great, I'm glad that worked.
I will be merging into the https://github.com/cybersemics/em/tree/table-fabian branch during your trial period. I recommend using that as your upstream rather than main
.
I will be merging into the ~
table-fabian
~ branch during your trial period. I recommend using that as your upstream rather thanmain
.
Sorry, I meant to name the branch https://github.com/cybersemics/em/tree/linewrap-fabian. Renamed.
Fixes #1826.
This PR handles a thought's height not accounting for the empty context view message. Since we want to trigger the update using a selector effect, we need delay the update until after the tree is done rendering.
requestAnimationFrame
seems to be the best and most idiomatic way of achieving this without using overly convoluted combinations ofuseSelectorEffect
anduseRef
, etc.