Can I safely use Input.prototype.inputRef?
See original GitHub issueHello!
I need to get a DOM node from Input
component. Not for focus only. For example I need to call input.setSelectionRange
.
So. I have not found how to get DOM node in the documentation. But I have found inputRef
in the code. May be it will be worth to add this property as “public” API in the documentation and TS definitions (like in this https://github.com/Semantic-Org/Semantic-UI-React/issues/1970)?
At the moment I can get input element only with findDOMNode
that is not a good React
practice.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How can I use ref in TextField - material ui - Stack Overflow
String refs are deprecated and material-ui does not support using them. ... a ref to the <input /> element you should use the...
Read more >Use a Refs in React to Create an Upload Component
We will first create the file input and then add a custom button component. The button will trigger the file upload functionality of...
Read more >How to Use React to Set the Value of an Input | Pluralsight
This guide will cover two different approaches to setting values of input elements. Controlled Input Approach. Form controls in React are a bit ......
Read more >React Tutorial #10 - Input Refs - YouTube
Hey, in this React tutorial for beginners, I'll introduce you to input Refs and how we can use them to reach into the...
Read more >How to use React createRef - LogRocket Blog
Learn how to use the React.createRef() method and useRef Hook in React to simplify creating refs and interact with the HTML DOM.
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
#1879 will introduce
innerRef
for all componentsBecause,
Form.Field
rendersdiv
as root element.