vite-pwa / docs

Documentation: PWA integrations for Vite and the ecosystem
https://vite-pwa-org.netlify.app/
MIT License
197 stars 45 forks source link

docs: update react and preact hook warn #52

Closed hikariNTU closed 1 year ago

hikariNTU commented 1 year ago

For React and Preact:

The text added:

The options provided to hooks are not reactive. Therefore, the callback references will be the first rendered options instead of the latest hook’s options. If you are doing complex logic with state changes, you will need to provide a stable reference function.

image


Although other frameworks examples may also suffer from same behavior, React and Preact are more likely to be misused due to how reactive works in both of them.

netlify[bot] commented 1 year ago

Deploy Preview for vite-pwa-org ready!

Name Link
Latest commit ebb342ea8bc8ec19c3f18c3a7e36899122000aa9
Latest deploy log https://app.netlify.com/sites/vite-pwa-org/deploys/64897e25d114590008cfab27
Deploy Preview https://deploy-preview-52--vite-pwa-org.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.