geist-ui icon indicating copy to clipboard operation
geist-ui copied to clipboard

fix(keyboard): improve keyboard hook with callback

Open antoinekm opened this issue 2 years ago • 2 comments
trafficstars

Checklist

  • [x] Fix linting errors
  • [x] Tests have been added / updated (or snapshots)

Change information

  • [x] Uses React.useCallback to memoize the event handler function for better performance and to avoid unnecessary re-renders.
  • [x] Adds all dependencies to the React.useCallback dependencies array to ensure that the function is correctly updated when any of its dependencies change.
  • [x] Uses React.useEffect with a full dependency array to ensure that the event listener is correctly added and removed when the component mounts and unmounts, respectively (which wasn't the case before).
  • [x] Adds default values to isCapture and elementEventType arguments of the elementBindingHandler function.

antoinekm avatar Apr 07 '23 09:04 antoinekm

Deploy Preview for geist-ui ready!

Name Link
Latest commit 1049c1af36aec2326997460ca79e18f6e6d72f3b
Latest deploy log https://app.netlify.com/sites/geist-ui/deploys/642fe2f03977a80008b5e469
Deploy Preview https://deploy-preview-831--geist-ui.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.

netlify[bot] avatar Apr 07 '23 09:04 netlify[bot]

Hey @unix can you give it a look ? 😁

antoinekm avatar Jun 29 '24 18:06 antoinekm