Skip to content

Allowing passing through of onLayout prop rather than overwriting #36

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

Merged
merged 1 commit into from
Jun 2, 2021
Merged

Allowing passing through of onLayout prop rather than overwriting #36

merged 1 commit into from
Jun 2, 2021

Conversation

bilewinters
Copy link
Contributor

Currently the onLayout prop of the main View that is used gets the measure function assigned to it.

As this happens after remaining props are spread into the View, if a user has passed onLayout in themselves, it is ignored.

As a fix, I'm calling this.props.onLayout inside the measure function (if it exists).

Copy link
Member

@Minishlink Minishlink left a comment

Choose a reason for hiding this comment

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

Thanks!

@Minishlink Minishlink merged commit 3839f29 into react-native-web-community:master Jun 2, 2021
@Minishlink
Copy link
Member

Available in 1.1.2

@bilewinters bilewinters deleted the pass-through-on-layout branch June 2, 2021 15:12
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