Skip to content

Added RefObject as valid Link innerRef - #6567

Merged
timdorr merged 3 commits into
remix-run:masterfrom
gcangussu:link-ref-object-proptype
Jan 31, 2019
Merged

Added RefObject as valid Link innerRef#6567
timdorr merged 3 commits into
remix-run:masterfrom
gcangussu:link-ref-object-proptype

Conversation

@gcangussu

Copy link
Copy Markdown
Contributor

When using React.createRef() with the innerRef prop of a Link, a false positive prop-types error appears. But it works perfectly.

This PR adds the shape of a RefObject (name for React.createRef() return type) as a valid prop type for Link's innerRef.

@timdorr

timdorr commented Jan 31, 2019

Copy link
Copy Markdown
Member

Seems like a no brainer to me. Thanks for the docs and test!

@timdorr
timdorr merged commit 89a72d5 into remix-run:master Jan 31, 2019
@serchavalos

Copy link
Copy Markdown

@timdorr 👋 Is there an ETA on when this fix will be released?

@pshrmn

pshrmn commented Mar 2, 2019

Copy link
Copy Markdown
Contributor

@danhilltech Oof, yeah, Element is a DOM API. This StackOverflow answer suggests an empty function polyfill for Node.

@danhilltech

Copy link
Copy Markdown

Ah thanks! Sorry, I removed my original as it realized it wasn't a super helpful report. Will try and polyfill now, thanks!

@pshrmn

pshrmn commented Mar 2, 2019

Copy link
Copy Markdown
Contributor

I added a polyfill in #6607.

@lock lock Bot locked as resolved and limited conversation to collaborators May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants