-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[TouchableHighlight] Automatically forward setNativeProps to the root subcomponent #97
Comments
Yeah, we want to do this but don't think we ever got around to it.
|
This seems useful! |
Feels like this would result in a change to React since the component renderer would need to hook up each owner's setNativeProps to the root it owns. Perhaps there is a less intrusive way with a mixin that we can experiment with and then make the change to React once we understand the space better. I think there is something useful here with automatic proxying between the owner and its root, like making onLayout work for composite components as well. |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out it's new home: https://productpains.com/post/react-native/touchablehighlight-automatically-forward-setnativeprops-to-the-root-subcomponent |
TouchableHighlight calls setNativeProps on its child, which is automatically handled by native views but not user-level composite components. In the examples I can think of off the top of my head, you'd typically want a composite component to forward setNativeProps to its root subcomponent i.e. the implementation looks like:
I propose this to be the default implementation if a component does not implement setNativeProps. This retains flexibility while I believe behaving reasonably in the default case.
The text was updated successfully, but these errors were encountered: