Skip to content

Instantly share code, notes, and snippets.

@JoviDeCroock
Created September 12, 2022 07:03
Show Gist options
  • Save JoviDeCroock/7b2aaedebd65e4e2feade36cf0ed904c to your computer and use it in GitHub Desktop.
Save JoviDeCroock/7b2aaedebd65e4e2feade36cf0ed904c to your computer and use it in GitHub Desktop.

10.11.0

New Hook: useId

Today we are announcing a new hook useId, this hook is meant to create stable unique identifiers that are consistent on both server-side render and client-side hydration. This feature can to enable a11y features for reusable components, ...

To enable the isomorphic unique identifiers you will need Preact-render-to-string 5.2.4 on the server.

(#3583, thanks @JoviDeCroock)

Fixes

  • Cleanup _parent, _dom and __hooks after unmount (#3709, thanks @JoviDeCroock)
  • Microbundle output formats after #3697 (#3702, thanks @rschristian)
  • fix case where we would omit the ref from reused vnodes (#3696, thanks @JoviDeCroock)
  • Pass errorInfo to useErrorBoundary callback (#3689, thanks @marvinhagemeister)
  • fix typescript definition for class | className (#3711, thanks @PodaruDragos)

Maintenance

  • Fix the mac arm build (#3697, thanks @gengjiawen)
  • add todo benchmark and add a proxy package that uses preact/hooks (#3708, thanks @JoviDeCroock)
  • chore: Add deprecation JSDoc for render()'s replaceNode (#3700, thanks @rschristian)
  • improve types for bare createElement and h calls (#3690, thanks @JoviDeCroock)
  • add test for useId (#3716, thanks @JoviDeCroock)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment