Forward refs for all components
See original GitHub issueOne of the requirements of any component exported from web3-ui
(or any React component library really) should be to wrap it in a call to forwardRef
. This would enable our users to access the ref
for any of our components.
If you’re not familiar with forwardRef
, the beta React docs have a section explaining it: https://beta.reactjs.org/learn/manipulating-the-dom-with-refs#accessing-another-components-dom-nodes
Components to convert:
@web3-ui/components
Address
AddressInput
NFT
NFTCard
NFTGallery
@web3-ui/core
ConnectWallet
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Forwarding Refs - React
Ref forwarding is an opt-in feature that lets some components take a ref they receive, and pass it further down (in other words,...
Read more >Forwarding refs to components | by Mario Kandut | Medium
Refs provide a way to access DOM nodes (or React elements) created in the render method, but why would you forward a reference?...
Read more >How to use React's forwardRef function - Felix Gerschau
forwardRef is a helper function from React that allows us to forward a component's ref to another one. This tutorial will teach what...
Read more >Using forwardRef in React to clean up the DOM
React forwardRef is a method that allows parent components pass down (i.e., “forward”) refs to their children. Using forwardRef in React ...
Read more >What is Ref Forwarding? - In Plain English
The React documentation states “You can forward refs to class component instances, too.” but sadly doesn't provide any example code.
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
Hey, y’all! I’d like to take this one!
hey @JorisZierold yeah this is still open but I recommend waiting until the current refactor is done. I’ll ping you here once that happens!