GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.
https://nativebase.io/
MIT License
20.2k stars 2.39k forks source link

Native-Base 2.15.2 incompatible with React-Native 0.69 #5358

Open Relax594 opened 2 years ago

Relax594 commented 2 years ago

Description

After updating React-Native from 0.68 to 0.69 app is not building anymore.

Error: Requiring module "node_modules\native-base\dist\src\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\'

Also this error pops up in console when trying to build: TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[14], "native-base").Item')

CodeSandbox/Snack link

not needed

Steps to reproduce

Upgrade React-Native from 0.68 to 0.69

NativeBase Version

2.15.2

Platform

Other Platform

No response

Additional Information

No response

ankit-tailor commented 2 years ago

Hey @Relax594, Thanks for reporting the issue. We'll look into it.

inspmoore commented 2 years ago

Same thing here. I'm on my way to prepare a PR for that.

wennaspeedy commented 2 years ago

Same here, last EXPO sdk.

knottronix commented 2 years ago

ah, this has been driving me crazy. Glad you have identified it, it's been a blocker for my team for more than a week now and we really need to release it with the latest EXPO sdk.

Very grateful for a speed resolution. Thanks

wennaspeedy commented 2 years ago

I already updated my app to native-base v3. Much faster than waiting for new version v2.

Relax594 commented 2 years ago

I already updated my app to native-base v3. Much faster than waiting for new version v2.

I don't get the migration "guide" or anything. The documentation on what has changed and how to migrate just isn't there and you can't just upgrade without destroying every bit of UI in basically any app we provide.

Therefore we stay with v2 as long as they at least merge pull requests with fixes from the community.

wardjk87 commented 2 years ago

https://github.com/facebook/react-native/issues/33734#issuecomment-1211119020. this solution worked for me.

Copied from comment above:

Created a file rn-polyfill-depricated-proptypes.js, and imported at top of index.js. Solved the issue for me

you may also change the get function to return from deprecated-react-native-prop-types

/* File: rn-polyfill-depricated-proptypes.js **/ const reactnative = require('react-native');

Object.defineProperty(reactnative, 'ColorPropType', { configurable: true, get() { return {}; }, });

Object.defineProperty(reactnative, 'EdgeInsetsPropType', { configurable: true, get() { return {}; }, });

Object.defineProperty(reactnative, 'PointPropType', { configurable: true, get() { return {}; }, });

Object.defineProperty(reactnative, 'ViewPropTypes', { configurable: true, get() { return {}; }, });

JeremyBradshaw7 commented 2 years ago

I put the polyfill in, and it's compiling and running, but on Android:

EDIT: I eventually got round these issues by copying the fonts again from node_modules/react-native-vector-icons/Fonts to android/app/src/main/assets/fonts.

maaliHasan commented 1 year ago

Same here! Any updates on this issue?

mkilincaslan commented 1 year ago

facebook/react-native#33734 (comment). this solution worked for me.

Copied from comment above:

Created a file rn-polyfill-depricated-proptypes.js, and imported at top of index.js. Solved the issue for me

you may also change the get function to return from deprecated-react-native-prop-types

/* File: rn-polyfill-depricated-proptypes.js **/ const reactnative = require('react-native');

Object.defineProperty(reactnative, 'ColorPropType', { configurable: true, get() { return {}; }, });

Object.defineProperty(reactnative, 'EdgeInsetsPropType', { configurable: true, get() { return {}; }, });

Object.defineProperty(reactnative, 'PointPropType', { configurable: true, get() { return {}; }, });

Object.defineProperty(reactnative, 'ViewPropTypes', { configurable: true, get() { return {}; }, });

Thank you this solved my issue!

R4DIC4L commented 1 year ago

Is there any way to release a new react-native v2 version to avoid doing the above hacks?

hubciorz commented 1 year ago

I am afraid that no fix for v2 is coming. What's more, they seem to abandon native-base v3 in favor of gluestack-ui.

NaseemLaghari commented 9 months ago

Picker in native base library is not working. I have 2.15.2 native base version and react native 0.72.3 version. Any solution?