github lynx-family/lynx-stack @lynx-js/react@0.121.0

latest releases: @lynx-js/rspeedy@0.14.4, @lynx-js/qrcode-rsbuild-plugin@0.4.7, @lynx-js/react-refresh-webpack-plugin@0.3.6...
3 hours ago

Minor Changes

  • Support React.createElement(type, props, children) API. (#2360)

    React.createElement('view', { style }, <text>hello</text>);
    // equivalent to
    <view style={style}>
      <text>hello</text>
    </view>;
    
    React.createElement(MyComponent, { style }, <view />);
    // equivalent to
    <MyComponent style={style}>
      <view />
    </MyComponent>;

Patch Changes

  • Clear transient snapshot child props when removed snapshot subtrees are detached, preventing compiled $* child references from retaining deleted list holder or list item subtrees after removal. (#2590)

  • Add createPortal for rendering a subtree into a different ReactLynx element identified by a NodesRef. (#2543)

    function App() {
      const [host, setHost] = useState(null);
      return (
        <view>
          <view ref={setHost} />
          {host && createPortal(<text>hi</text>, host)}
        </view>
      );
    }
  • Default fireEvent to bubbles: true for the TouchEvent family in testing-library to match Lynx runtime semantics, and stop reassigning the read-only Event.prototype accessors which threw TypeError in strict mode. (#2532)

  • Set bundle-url on lazy bundle border elements. (#2537)

  • Stop warning when runWorklet receives an invalid or missing main-thread function object. Invalid worklet contexts are still ignored, but nullish handler values no longer produce noisy MainThreadFunction: Invalid function object console output. (#2586)

  • Retain main-thread worklet context references before offscreen snapshot elements are materialized, so event, ref, gesture, and spread callbacks stay alive until the DOM update path can attach them. (#2592)

  • Update the @lynx-js/tasm dependency to 0.0.39 and align React template attribute descriptors with it. (#2643)

  • Avoid retaining transformed nested worklet contexts after worklet transformation. (#2591)

    Nested worklets transformed by the worklet runtime now keep their context recovery metadata through a weak reference, preventing cached transformed worklet functions from keeping list-item worklet contexts alive.

Don't miss a new lynx-stack release

NewReleases is sending notifications on new releases.