From 19c4f5a6115adf30b28dcc2d1d70519aac8a1417 Mon Sep 17 00:00:00 2001 From: Thomas Jun Yamasaki Date: Mon, 3 Aug 2020 20:59:44 -0300 Subject: [PATCH] fix: handling innerRef (#8) * fix: handling innerRef * 0.0.7 --- modules/Link.js | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/Link.js b/modules/Link.js index 89368a2..25916f0 100644 --- a/modules/Link.js +++ b/modules/Link.js @@ -80,7 +80,13 @@ class Link extends Component { if (router) { if (withRef) { - props.ref = (c) => withRef(c) + props.ref = (c) => { + if (typeof innerRef === 'function') { + innerRef(c) + } + + return withRef(c) + } } // If user does not specify a `to` prop, return an empty anchor tag. diff --git a/package.json b/package.json index b8bb2c1..6f00608 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@quintoandar/react-router", - "version": "0.0.6", + "version": "0.0.7", "description": "React Router v3 compatible with concurrent mode", "files": [ "*.md",