Add support for React 16.3 createRef type of ref
See original GitHub issueUsing connectDragSource with an element that is using the new createRef API (introduced in React 16.3.0) instead of callback refs causes the app to crash with the error: TypeError: previousRef is not a function
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:41
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Refs and the DOM - React
Refs are created using React.createRef() and attached to React elements via the ref attribute. Refs are commonly assigned to an instance property when...
Read more >Introduction to Refs in React 16.3 | by Sean Groff | Medium
In your class constructor method create a class property and assign React.createRef() to it. Add Ref to DOM Element. Tell React to associate...
Read more >How to use refs in React with Typescript - Stack Overflow
If you're using React 16.3+, the suggested way to create refs is using React.createRef() . class TestApp extends React.
Read more >How to use React createRef - LogRocket Blog
React provides a feature known as refs that allow for DOM access from components. You simply attach a ref to an element in...
Read more >What is significance of refs in ReactJS ? - GeeksforGeeks
Create a ref variable using React.createRef(). It was introduced in React 16.3.I version. · Attach ref variable to the React element by using...
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
Same issue. Should I revert to using the old callback ref, or is there a way to work around this?
I was able to use a workaround as suggested by encapsulating the ref div inside another blank div. example: