Skip to content

Detect if Text.propTypes actually exists for web#11

Merged
obipawan merged 1 commit intoobipawan:masterfrom
RangerMauve:patch-1
Apr 14, 2017
Merged

Detect if Text.propTypes actually exists for web#11
obipawan merged 1 commit intoobipawan:masterfrom
RangerMauve:patch-1

Conversation

@RangerMauve
Copy link
Contributor

I'm using react-native-web in conjunction with this library in order to support more platforms with the same codebase.

When building our app for development, everything works properly and this library does exactly what we need it to.

However, react-native-web excludes propTypes when you do a production build in order to reduce bundle size and improve performance.

This leads to issues when libraries depend on propTypes being defined.

I propose feature-detecting whether Text.propTypes is actually defined so that people using react-native-web, or any bundlers for native that reduce size agressively, without affecting current users.

I'm using [react-native-web](https://github.com/necolas/react-native-web) in conjunction with this library in order to support more platforms with the same codebase.

When building our app for development, everything works properly and this library does exactly what we need it to.

However, react-native-web excludes propTypes when you do a production build in order to reduce bundle size and improve performance.

This leads to [issues](necolas/react-native-web#423) when libraries depend on propTypes being defined.

I propose feature-detecting whether Text.propTypes is actually defined so that people using react-native-web, or any bundlers for native that reduce size agressively, without affecting current users.
@obipawan obipawan merged commit 378a943 into obipawan:master Apr 14, 2017
@obipawan
Copy link
Owner

Thanks for the addition @RangerMauve
Did you make any headway with react-native-web#423?
A plugin to assign an empty object to the PropTypes in production seems like a better option.
I'll merge this though as it won't be affecting current users.

@obipawan
Copy link
Owner

available on react-native-hyperlink@0.0.9

@RangerMauve
Copy link
Contributor Author

Yeah, right now we're talking to the authors of the plugin about doing just that here

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