fix(withTheme): refs on functional components wrapped by marcshilling · Pull Request #3708 · react-native-elements/react-native-elements
Motivation
My team was attempting to attach a ref to one of our custom components that is wrapped with the withTheme higher 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 use refs on our components wrapped with withTheme.
Type of change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
How Has This Been Tested?
- Jest Unit Test
- Checked with
exampleapp
Checklist
- My code follows the style guidelines of this project
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have made corresponding changes to the documentation using
yarn docs-build-api - My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature works
- New and existing unit tests pass locally with my changes
- Any dependent changes have been merged and published in downstream modules