Skip to content

Comments

Fix: don't pass ref to react-polyglot 'translate' function component#2607

Merged
erquhart merged 1 commit intodecaporg:masterfrom
erezrokah:fix/ref_on_function_component_warning
Sep 4, 2019
Merged

Fix: don't pass ref to react-polyglot 'translate' function component#2607
erquhart merged 1 commit intodecaporg:masterfrom
erezrokah:fix/ref_on_function_component_warning

Conversation

@erezrokah
Copy link
Contributor

Fixes #2098

translate creates a function component hence the warning.

If the ref is really needed (I'm assuming not at the moment) we can:

or

@erezrokah erezrokah changed the title fix: don't pass ref to react-polyglot 'translate' function component Fix: don't pass ref to react-polyglot 'translate' function component Aug 27, 2019
@erquhart
Copy link
Contributor

erquhart commented Sep 4, 2019

It does look like this fell out of use, which would mean the places we're running getWrappedInstance() are also obsolete.

@erquhart
Copy link
Contributor

erquhart commented Sep 4, 2019

I would normally say we should drop the last two optional args for connect() entirely, but since there's still more clean up for it's proper removal, this is maybe better.

@erquhart erquhart merged commit 5b64e25 into decaporg:master Sep 4, 2019
@erezrokah
Copy link
Contributor Author

I would normally say we should drop the last two optional args for connect() entirely, but since there's still more clean up for it's proper removal, this is maybe better.

You're right I though about removing the redundant parameters all together, but thought it might have some value in explicitly showing the ref is not needed here.

@lucasbarth
Copy link

Hey I am experiencing a similar issue was just curious if this hasn't gotten fixed because only 8 / 13 checks are passing on the review. Let me know, I can help move it along if needed possibly.

@erezrokah erezrokah deleted the fix/ref_on_function_component_warning branch October 23, 2019 07:39
nathankitchen pushed a commit to nathankitchen/netlify-cms-backend-azure that referenced this pull request Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React 16.8.1 ref= warning

3 participants