usehooks icon indicating copy to clipboard operation
usehooks copied to clipboard

A collection of modern, server-safe React hooks – from the ui.dev team

Results 106 usehooks issues
Sort by recently updated
recently updated
newest added

At the moment if a component that uses `useLocalStorage` rerenders then `useLocalStorage` will call `JSON.parse(store)` as a result of the rerender. The value of `store` won't have changed, but the...

need to merge https://github.com/uidotdev/usehooks/pull/304

Replaced `JSON.stringify` and `JSON.parse ` to use [superjson](https://github.com/blitz-js/superjson) instead so we can parse objects such as maps and more that's not supported by default

Fixes #312 The copyToClipboard function is not returning a promise currently. The intention (at least according to the function signature) is to fulfill the promise when the text is copied:...

The `copyToClipboard ` function is not returning a promise after copying text, see: ``` export default function App() { const [copiedText, copyToClipboard] = useCopyToClipboard(); return ( { copyToClipboard('text').then(() => {...

Hi, first of all, thank you for providing a nice library. I love this and am learning a lot I have some questions. In your code, The `useLocalStorage` hook uses...

`useLocalStorage` can not handle [batch updates](https://react.dev/learn/queueing-a-series-of-state-updates#updating-the-same-state-multiple-times-before-the-next-render) correctly, this PR will fix that. It does not call the update function with the current state in the local storage. It uses the...

The idea is instead of writing a component like: ```tsx export function MyComponent(props: { doSomethingAsync: () => Promise; }) { const [status, setStatus] = useState({ state: 'pending', }); return (...

- The `onShellReady` and `onAllReady` both hits > 4 seconds 1 out of 10 times with using `useWindowSize` and `useOrientation` hook - 90% of the time, the time is <...

This fixes a couple issues that lead to subtle timing bugs in useThrottle. For an example, see [this codesandbox](https://codesandbox.io/p/sandbox/gracious-pike-vmzh2k?file=%2Fsrc%2FApp.js%3A11%2C69-12%2C39) and notice how throttledValue (current implementation) updates kind of choppily and...