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
Make react-intl react 16 compatible #1201
Conversation
As mentioned by @ericf in this usage how to access the ref from the injectIntl component. And thats how we use it through out our web app's as well. |
Tests are failing because of current state in master i would say?
|
Thanks for the PR. I'm fine merging if it doesn't break anyone. As for the failing build, it looks like one of the tests are failing:
It's not related to your PR, since master has the same problem, but do you mind seeing if it's an easy fix? |
Sadly i can't reproduce this locally with same node version and can't really find the cause for this. |
Any way to retrigger the test @redonkulus or continue to merge this anyway? |
So the unit tests pass but the coverage is below 100%. |
TBH looking at the tests it look seriously solid. @redonkulus |
But i will take a look if I can find something |
Sorry @redonkulus I cant bring this to 100, its complaining about the ref callback assignment and I can't really find a way to test that "logic". Can you give me some insights? |
@ptomasroos A quick googling found this answer for testing the ref: https://stackoverflow.com/questions/48088489/react-jestjs-enzyme-how-to-test-for-reference-function Another option you can do for coverage sake is just have jest ignore that line. |
… invariant check where its implicitly covering the ref callback
Thanks for the patience @redonkulus. Hence I added a ignore line instead since I already feel this is covered through the existing lines which check the ref assignment through the invariant checks. Would be great if we could merge and release this in order to avoid splitting the community into branches and forks as currently 16.6 users need to use https://www.npmjs.com/package/@freedombase/react-intl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the work here!
published in v2.7.2 |
Commits: - Make react-intl react 16 compatible (formatjs#1201) 1c5afd2
Commits: - Make react-intl react 16 compatible (formatjs#1201) 1c5afd2
Closes #1078
This is not a breaking change since the access of the ref is used when calling getWrappedInstance()
In order to support React 16. We need to remove the legacy way of using ref's by setting a string.
This is now marked as legacy.
https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs