Allow the use of `ref` in the button component
See original GitHub issueI am trying to use the Button
-component together with the Reach UI library’s AlertDialog
and it’s causing some trouble because you can’t use ref
with the Button
-component. The React documentation suggests that forwardRef
can be used to allow this, see:
https://reactjs.org/docs/forwarding-refs.html
Potentially, this would also avoid change the Input
etc to class components at the same time
react-bulma-components
version in use is: 2.1.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (4 by maintainers)
Top Results From Across the Web
Refs and the DOM - React
Refs provide a way to access DOM nodes or React elements created in the render method. In the typical React dataflow, props are...
Read more >Accessing button using ref - javascript - Stack Overflow
Button is a component (does not have ref by default) and button is a primitive element (always has ref by default). If you...
Read more >Using refs in React functional components (part 1) - useRef + ...
To create a reference to a DOM node in a component we can do it either using the useRef() hook, which for most...
Read more >A complete guide to React refs - LogRocket Blog
Learn how to use React refs, and why it's important to use them only when React can't handle a function call through its...
Read more >Everything You Need to Know About Refs in React
var onClick = function() { console.log("Clicked!"); } var button ...
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
Hi @MrCreeper1008 Thank for your effort! If you want to can you share the code of your changes I will try to give you a hand (I’m quite full now but I will try to organize my self to be able to work on this)
Thanks!
Hi @MrCreeper1008 I think it should be a one PR, and as you suggest ship it with #97