Skip to content

[TouchableHighlight] Automatically forward setNativeProps to the root subcomponent #97

@ide

Description

@ide

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:

setNativeProps(nativeProps) {
  this.refs['root'].setNativeProps(nativeProps);
}
render() {
  return <Subcomponent ref="root">...</Subcomponent>;
  // If Subcomponent is composite, it will recursively forward setNativeProps
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions