Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing <Link>'s underlying node via innerRef #5294

Merged
merged 3 commits into from
Jun 28, 2017
Merged

Accessing <Link>'s underlying node via innerRef #5294

merged 3 commits into from
Jun 28, 2017

Commits on Jun 28, 2017

  1. 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 :)
    danielberndt authored Jun 28, 2017
    Configuration menu
    Copy the full SHA
    6df0a48 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    47e529a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bda5ebd View commit details
    Browse the repository at this point in the history