Closed prinsss closed 1 year ago
Latest commit: 79efe32437784a2f7583fc727f9f99324289d11d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Link |
---|---|
Latest commit | 79efe32437784a2f7583fc727f9f99324289d11d |
Latest deploy log | https://app.netlify.com/sites/preact-signals-demo/deploys/650ad4404da9e9000857644a |
Deploy Preview | https://deploy-preview-415--preact-signals-demo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Thanks!
Description
This fixes "useMemo undefined" error when using
useSignal
hook with UMD scripts.The UMD builds of
preact/hooks
package will attach itself to the globalwindow.preactHooks
when using CDN, while@preact/signals
is searching forwindow.hooks
and cause this problem.There is also some messages about this in microbundle's output log:
Bug Reproduction
Here is a minimal reproduction page demonstrating the issue.
https://stackblitz.com/edit/preact-signals-cdn
Expected Changes
The changes to the UMD build of
@preact/signals
package after applying this patch is as below: