-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(withTheme): refs on functional components wrapped #3708
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
fix(withTheme): refs on functional components wrapped #3708
Conversation
Codecov Report
@@ Coverage Diff @@
## next #3708 +/- ##
==========================================
- Coverage 79.44% 79.39% -0.05%
==========================================
Files 87 87
Lines 1824 1820 -4
Branches 796 810 +14
==========================================
- Hits 1449 1445 -4
Misses 370 370
Partials 5 5
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
pranshuchittora
left a comment
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.
Overall looks good to me. Haven't run the changes locally. Merge it, if you have tested this.
Also can we write some updated tests for this, probably some snapshot tests.
✅ Deploy Preview for react-native-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Co-authored-by: Marc Shilling <marc.shilling@stadiumgoods.com>
Co-authored-by: Marc Shilling <marc.shilling@stadiumgoods.com>
Motivation
My team was attempting to attach a
refto one of our custom components that is wrapped with thewithThemehigher order component, but it wasn't working. Upon digging into the HOC, I quickly noticed that react-native-elements is only doing ref forwarding for class components, but seemingly not for functional components. I don't see any reason for this, and after patching this change locally everything works fine for us and we are now able to userefs on our components wrapped withwithTheme.Type of change
How Has This Been Tested?
exampleappChecklist
yarn docs-build-api