Skip to content
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

access to screen components via Actions.refs #2248

Merged
merged 1 commit into from
Aug 16, 2017
Merged

access to screen components via Actions.refs #2248

merged 1 commit into from
Aug 16, 2017

Conversation

aksonov
Copy link
Owner

@aksonov aksonov commented Aug 16, 2017

access to screen components via Actions.refs (#2195)

@aksonov aksonov merged commit 5e77888 into master Aug 16, 2017
}
render() {
const navigation = this.props.navigation;
return <Component ref={ref => (this.ref = ref)} {...this.props} {...navigation.state.params} name={navigation.state.routeName} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aksonov This causes React warning if the Component is stateless:

Warning: Stateless function components cannot be given refs. Attempts to access this ref will fail.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. However making Screens as pure function is not good idea - hot reload will not work for them...

@daviscabral daviscabral deleted the 2195 branch August 18, 2018 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants