Add react hooks support
See original GitHub issueHi! Thank you for your package
I’m wondering, are there any plans to support React hooks? Something like
const {width, height} = useResizeDetector(ref);
I believe it can be useful nowadays
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Introducing Hooks - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. ... This...
Read more >Hooks at a Glance - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. Hooks are...
Read more >React v16.8: The One With Hooks
React Hooks are now supported by React DevTools. They are also supported in the latest Flow and TypeScript definitions for React.
Read more >Building Your Own Hooks - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. Building your...
Read more >Hooks FAQ - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. This page...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great push, @LosYear 😃
I also think it will be a good feature for the library. I’ll try to work on it this month
Typescript support? Setting ref={ref} in typescripts it says that
Type ‘MutableRefObject<Element | undefined>’ is not assignable to type ‘string | ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined’. Type ‘MutableRefObject<Element | undefined>’ is not assignable to type ‘RefObject<HTMLDivElement>’. Types of property ‘current’ are incompatible. Type ‘Element | undefined’ is not assignable to type ‘HTMLDivElement | null’. Type ‘undefined’ is not assignable to type ‘HTMLDivElement | null’.