fix(withTheme): refs on functional components wrapped#3708
Merged
arpitBhalla merged 4 commits intoreact-native-elements:nextfrom Mar 21, 2023
Merged
fix(withTheme): refs on functional components wrapped#3708arpitBhalla merged 4 commits intoreact-native-elements:nextfrom
arpitBhalla merged 4 commits intoreact-native-elements:nextfrom
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 |
arpitBhalla
approved these changes
Mar 2, 2023
pranshuchittora
approved these changes
Mar 20, 2023
Member
pranshuchittora
left a comment
There was a problem hiding this comment.
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. |
github-actions bot
pushed a commit
that referenced
this pull request
Mar 21, 2023
Co-authored-by: Marc Shilling <[email protected]>
github-actions bot
pushed a commit
that referenced
this pull request
Mar 21, 2023
Co-authored-by: Marc Shilling <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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