deanhet / react-native-text-ticker

React Native Text Ticker/Marquee Component
MIT License
444 stars 75 forks source link

Make library compatible with Expo Web #107

Closed meowsus closed 3 years ago

meowsus commented 3 years ago

Related to #81, when trying to use this library with Expo, an error is thrown when importing. The library chokes on Text.propTypes.style. Admittedly I am not sure how to properly import PropTypes from React Native, as it seems that they have been deprecated, but regardless there is no reason I can think of as to why this library should not be considered compatible with Expo when an app is being previewed in web-mode.

meowsus commented 3 years ago

@deanhet Totally happy to provide a different solution, but I've yet to be able to find out how to declare the prop types of a React Native style prop the right way.

deanhet commented 3 years ago

I had no idea that propTypes were removed from react now so good catch. I'm also a huge fan of your commit messages.

I think it would be worth deleting all mention of propTypes instead. The any is just a hack and all of this can be and is documented in the readme / can be added in typescript

meowsus commented 3 years ago

PropTypes removed!

deanhet commented 3 years ago

Great! I think defaultProps should stay though, can you test your setup with defaultProps included? I'm worried about knock on effects that may have if we delete it.

meowsus commented 3 years ago

Updated and tested. Seems to be working well.

deanhet commented 3 years ago

Brilliant, thanks for that. Will merge and push a release later today.

Thanks for contributing!

meowsus commented 3 years ago

Absolutely!