Skip to content

Override this.props with custom props if prop value is equal to defau… #3

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
Apr 18, 2017
Merged

Conversation

knalinne
Copy link
Contributor

@knalinne knalinne commented Apr 18, 2017

Hello,

I had an issue with this code

const globalTextProps = { allowFontScaling: false, }; setCustomText(globalTextProps);

allowFontScaling is a default prop on Text component, the current implementation do not allow a custom value if a default value is defined on the component.

for each custom prop, I now compare the current value with the default value and use the custom prop if it's equal

@Ajackster
Copy link
Owner

Thanks @knalinne !

@Ajackster Ajackster merged commit f376241 into Ajackster:master Apr 18, 2017
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