nandorojo / dripsy

🍷 Responsive, unstyled UI primitives for React Native + Web.
https://dripsy.xyz
MIT License
2.01k stars 80 forks source link

Gradient RN ViewPropTypes Deprecation Error #236

Closed bennettfrazier closed 2 years ago

bennettfrazier commented 2 years ago

Hi @nandorojo – I ran into an issue installing the gradient component, getting this error thrown whenever I import

Requiring module "node_modules/@dripsy/gradient/node_modules/expo-modules-core/build/index.js", which threw an exception: Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.

Followed the docs, and happens whenever I try adding in the import or add gradient theme presets:

// error happens on import
import { Gradient } from '@dripsy/gradient'

// or when adding in a linear gradient theme config
linearGradients: {
    $appBgFade: ['$appBgTransparent', '$appBg']
},

Not super familiar with Typescript or how to resolve, but discovered these two React Native issues while debugging: #33734 and #33557

nandorojo commented 2 years ago

yeah i need to fix this when i have time

bennettfrazier commented 2 years ago

Gotcha, is it as simple as this to resolve? https://github.com/facebook/react-native/issues/33557#issuecomment-1212212561

If so, where would this need to be replaced? I did a search in the repo for ViewPropTypes but didn't see any results.

nandorojo commented 2 years ago

Can you try upgrading to 3.7.x for both dripsy and the gradient?

bennettfrazier commented 2 years ago

Saw issue was closed, and confirmed upgrading to latest works (3.8) on my end.

Nice, thank you! 🎊