-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accessing <Link>'s underlying node via
innerRef
(#5294)
* Accessing <Link>s underlying node via `innerRef` Use case: [`react-measure`](https://github.com/souporserious/react-measure): I'd like to show a tooltip above a Link. For this I need to know the underlying DOM node's position. Proxying the `ref` via an `innerRef`-prop would allow to do this. (I stole the naming from [`glamorous`](https://github.com/paypal/glamorous#innerref)) This would allow to extract the position like this: ```jsx <Measure bounds>{({measureRef}) => <Link to="..." innerRef={measureRef}/> }</Measure> ``` Happy to adapt docs in this PR if you think this is worthwhile :) * add test case for Link’s innerRef * add innerRef to Link’s api docs
- Loading branch information
1 parent
920af5b
commit 81c5a02
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters