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

latest releases: @lynx-js/web-constants@0.19.9, @lynx-js/web-core-wasm@0.0.6, @lynx-js/react-refresh-webpack-plugin@0.3.5...
10 hours ago

Minor Changes

  • feat: export GlobalPropsProvider, GlobalPropsConsumer, useGlobalProps and useGlobalPropsChanged for __globalProps (#2346)

    • GlobalPropsProvider: A Provider component that accepts children. It is used to provide the lynx.__globalProps context.
    • GlobalPropsConsumer: A Consumer component that accepts a function as a child. It is used to consume the lynx.__globalProps context.
    • useGlobalProps: A hook that returns the lynx.__globalProps object. It triggers a re-render when lynx.__globalProps changes.
    • useGlobalPropsChanged: A hook that accepts a callback function. The callback is invoked when lynx.__globalProps changes.

    Note: When globalPropsMode is not set to 'event' (default is 'reactive'), these APIs will be ineffective (pass-through) and will log a warning in development mode, as updates are triggered automatically by full re-render.

  • BREAKING CHANGE: (#2319)

    Change preact package from @hongzhiyuan/preact to @lynx-js/internal-preact.

    Upgrade preact from f7693b72 to 55254ef7, see diffs at f7693b72...55254ef7.

  • feat: add globalPropsMode option to PluginReactLynxOptions (#2346)

    • When configured to "event", updateGlobalProps will only trigger a global event and skip the runWithForce flow.
    • Defaults to "reactive", which means updateGlobalProps will trigger re-render automatically.

Patch Changes

  • Add __BACKGROUND__ guard on onBackgroundSnapshotInstanceUpdateId event to prevent bundling to main-thread on dev environment. (#2332)

  • refactor: extract static string in template literal (#2334)

  • fix: avoid crash when spread undefined ref (#2333)

  • Avoid registering lifecycle refs for main-thread functions (MTF) that have not received an execId during renderPage() first-screen binding. (#2320)

Don't miss a new lynx-stack release

NewReleases is sending notifications on new releases.