question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Forward refs for all components

See original GitHub issue

One 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
OrlundoHubbardcommented, Dec 24, 2021

Hey, y’all! I’d like to take this one!

1reaction
Dhaiwat10commented, Apr 16, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found