react-hook
react-hook copied to clipboard
↩ Strongly typed, concurrent mode-safe React hooks
**Describe the bug** The `useSize()` function in the demo for @react-hook/resize-observer uses the anti-pattern of depending on the ref object provided by `React.useRef()` in the dependency list of `React.useLayoutEffect()`. This...
Hello, First, thanks a lot for these great hooks :heart_eyes: I am using some of them in a project. I am upgrading dependencies, and some hooks have new versions. I...
Trying to implement zoom behaviour in a app, and want to use standard keybindings: ``` CMD + 0 -- zoom to 100% CMD + - -- zoom out CMD +...
**Describe the bug** This isn't necessarily a bug, however I thought I would point it out in case it is unintentional. The `useTimeoutCallback` function [here]( https://github.com/jaredLunde/react-hook/blob/84466d904a3de2cadf57681fd39598d8854e4a49/packages/timeout/src/index.tsx#L47), only has 2 parameters...
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3. Changelog Sourced from shell-quote's changelog. 1.7.3 Fix a security issue where the regex for windows drive letters allowed some shell meta-characters to escape the...
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1. Commits 64735d2 v4.1.1 75a657d Fix potential ReDoS (#37) See full diff in compare view [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this...
**Describe the bug** Regardless of position, position increments as 1 and starts at 0.5, so 1.5, 2.5, 3.5 etc. Will track to -0.5 before pos value is set to none...
**Describe the bug** `jest-environment-jsdom` v28+ tries to use `browser` exports instead of default exports which generates the following error when Jest `testEnvironment: 'jsdom'`: ``` Jest encountered an unexpected token Jest...
### Closing issues It closes #300
``` //useElementSize.tsx import useResizeObserver from '@react-hook/resize-observer'; import { MutableRefObject, useLayoutEffect, useState } from 'react'; interface Size { width: number; height: number; } export default function useElementSize( target: MutableRefObject, ) {...