Minor Changes
-
Fixed closure variable capture issue in effect hooks to prevent stale values and ensured proper execution order between refs, effects, and event handlers. (#770)
Breaking Changes:
- The execution timing of
ref
,useEffect()
callback,componentDidMount
,componentDidUpdate
,componentWillUnmount
and the callback ofsetState
have been moved forward. These effects will now execute before hydration is complete, rather than waiting for the main thread update to complete. - For components inside
<list />
,ref
callbacks will now be triggered during background thread rendering, regardless of component visibility. If your code depends on component visibility timing, usemain-thread:ref
instead of regularref
.
- The execution timing of
Patch Changes
-
Fixed two memory leaks: (#1071)
-
When JSX is rendered on the main thread and removed, FiberElement can still be referenced by
__root.__jsx
throughprops.children
; -
When the SnapshotInstance tree is removed from the root node, its child nodes form a cycle reference because the
__previousSibling
and__nextSibling
properties point to each other, thus causing a FiberElement leak.
-
-
Optimize the error message when snapshots cannot be found in the main thread. (#1083)
-
Fix a problem causing
MainThreadRef
s to not be updated correctly during hydration when they are set tomain-thread:ref
s. (#1001) -
Add snapshot id report when throwing
snapshotPatchApply failed: ctx not found
error. (#1107) -
Fix a bug in ReactLynx Testing Library that rendered snapshot of inline style was normalized incorrectly (eg.
flex:1
was normalized toflex: 1 1 0%;
incorrectly). (#1040)