fix resize on update children components & simplified#310
fix resize on update children components & simplified#310kir4ik wants to merge 1 commit intonkbt:masterfrom
Conversation
|
If child component is updated, this is not supposed to be tracked in snapshot. |
https://codepen.io/Kira4/pen/bGvEgRJ?editors=0010 This is a rough example, but still it seems to me that even this should work. |
|
I don't think it is a good example with timeout 0 More realistically it would be smth else like this As long as timeout is not 0 - no problems anymore. Or if there is not timeout - same no problem. |
https://codepen.io/Kira4/pen/ExEPWKQ?editors=0010 It's not about the timeout. Just a promise that ended quickly For example, there is a validator interface, the validation method is asynchronous, and it doesn’t matter how it is implemented, there may be a request to the server, there may not be any requests and immediately validate on the client |
|
Yeah makes sense. Need to check all the edge-cases with this update. There certainly was a reason to put logic in snapshot before update, but I do not remember why anymore. |
|
Hello! Unfortunately, I am experiencing the same problem so I would appreciate any updates on this. Do you mind moving this PR forward? |
if child components are redrawn with a new height, this is not always tracked in getSnapshotBeforeUpdate. Therefore, I moved the height setting logic to onResize. In addition, getSnapshotBeforeUpdate assumes the use of previous states, but here it is not necessary, onResize has everything you need