Skip to content
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

tabStyle: ViewPropTypes.style undefined on latest version of expo #3264

Closed
GeorgeBellTMH opened this issue Oct 2, 2020 · 15 comments
Closed

Comments

@GeorgeBellTMH
Copy link

Getting the following after upgrading to latest version of expo...

TypeError: Cannot read property 'style' of undefined
~/node_modules/native-base/dist/src/basic/Tabs/DefaultTabBar.js
C:/Users/src/basic/Tabs/DefaultTabBar.js:26
23 | activeTextColor: PropTypes.string,
24 | inactiveTextColor: PropTypes.string,
25 | disabledTextColor: PropTypes.string,

26 | tabStyle: ViewPropTypes.style,
| ^ 27 | renderTab: PropTypes.func,
28 | underlineStyle: ViewPropTypes.style,
29 | tabContainerStyle: ViewPropTypes.style,

@GeorgeBellTMH GeorgeBellTMH changed the title tabStyle: ViewPropTypes.style undefined tabStyle: ViewPropTypes.style undefined on latest version of expo Oct 2, 2020
@NishargShah
Copy link

Yes, solve this error ASAP ;_;

@hanykumar
Copy link
Contributor

Hi @GeorgeBellTMH , Is the bug present in web, iOS or Android?

@GeorgeBellTMH
Copy link
Author

web

@hanykumar hanykumar added the web label Oct 5, 2020
@hanykumar
Copy link
Contributor

This is a known issue and we are working on it.

@matias91
Copy link
Contributor

Hi, @hanykumar!

I found the same issue in a different repo (react-native-web-swiper), and they solved it replacing:

ViewPropTypes.style

with:

PropTypes.shape({
  style: PropTypes.any,
}),

I tested this change locally and it seems to work with this repo too.
I had to do this change in DefaultTabBar.js, ScrollableTabBar.js and Tabs/index.js.
Those files are already importing PropTypes and using it, so looks like a suitable solution.

I can create a PR if you think this is okay. Or if the team is working in a different solution I'll just wait.

Thanks for your work and your time!

@pratikthakkar
Copy link

any updates here ?

@prasadsrg
Copy link

In Web still facing same problem, just import the native-base we are getting this issue, which is blocker for us.

TypeError: Cannot read property 'style' of undefined
../../../native-base/dist/src/basic/Tabs/DefaultTabBar.js
src/basic/Tabs/DefaultTabBar.js:26
 23 | activeTextColor: PropTypes.string,
 24 | inactiveTextColor: PropTypes.string,
 25 | disabledTextColor: PropTypes.string,
**> 26 | tabStyle: ViewPropTypes.style,**
    **| ^  27 | renderTab: PropTypes.func,**
 28 | underlineStyle: ViewPropTypes.style,
 29 | tabContainerStyle: ViewPropTypes.style,
View compiled
__webpack_require__
/Volumes/work/projects/test/native-base-app/webpack/bootstrap:789
 786 | };
 787 | 
 788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
     | ^  790 | 
 791 | // Flag the module as loaded
 792 | module.l = true;

@cspecter
Copy link

cspecter commented Dec 3, 2020

Is this PR going to every be integrated? We got it working by installing this specific PR, but there are other bugs we are running in to that have been fixed in the main branch.

@richagain
Copy link

Hi, @hanykumar!

I found the same issue in a different repo (react-native-web-swiper), and they solved it replacing:

ViewPropTypes.style

with:

PropTypes.shape({
  style: PropTypes.any,
}),

I tested this change locally and it seems to work with this repo too.
I had to do this change in DefaultTabBar.js, ScrollableTabBar.js and Tabs/index.js.
Those files are already importing PropTypes and using it, so looks like a suitable solution.

I can create a PR if you think this is okay. Or if the team is working in a different solution I'll just wait.

Thanks for your work and your time!

I tried your solution but it didn't work.

@gajendrapratap
Copy link

can any one tell how i can solve below error:

TypeError: Cannot read property 'style' of undefined
Module.../../../react-native-looped-carousel/index.js
../node_modules/react-native-looped-carousel/index.js:38

@prasadsrg
Copy link

this is error is from long back, there are not care about it. I moved to UI Kitten 5.0

@i6mi6
Copy link

i6mi6 commented Jun 8, 2021

I solved it by going into

node_modules/native-base/dist/src/utils/index.js

then replacing exports.ViewPropTypes=_reactNative.ViewPropTypes;

with

var PropTypes=require('prop-types');exports.ViewPropTypes=PropTypes.shape({ style: PropTypes.any });

Then patching it by calling npx patch-package native-base

@embray
Copy link

embray commented Jun 9, 2021

This looks like a duplicate of #3130. It was fixed in native-base as of 2.15.2 (I had the same problem and confirmed that updating fixed it). So this issue can be closed.

@stale
Copy link

stale bot commented Feb 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 2, 2022
@stale stale bot closed this as completed Apr 3, 2022
@frknltrk
Copy link

frknltrk commented May 15, 2022

Hi, @hanykumar!

I found the same issue in a different repo (react-native-web-swiper), and they solved it replacing:

ViewPropTypes.style

with:

PropTypes.shape({
  style: PropTypes.any,
}),

I tested this change locally and it seems to work with this repo too. I had to do this change in DefaultTabBar.js, ScrollableTabBar.js and Tabs/index.js. Those files are already importing PropTypes and using it, so looks like a suitable solution.

I can create a PR if you think this is okay. Or if the team is working in a different solution I'll just wait.

Thanks for your work and your time!

now a better fix (replacement) is available: PropTypes.style instead of just ViewPropTypes.style

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests