-
-
Notifications
You must be signed in to change notification settings - Fork 153
TypeError: Cannot read property 'number' of undefined #139
Comments
That's a very strange error, possibly an issue to do with proptypes? Are your components using the Also, possibly unrelated, you seem to be using both |
Hi, i don´t use any proptypes validator in my components. You are right, i think is relationated with this Note: React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead. What versions of jest and react-native supports react-native-mock? |
Documentation on support is unfortunately kinda lacking. I dont have support for any version of |
Ok, thank you very much, I'll wait for the new version. |
According to me it is because the package still imports the propTypes from react. |
Any expectations when it will be fixed? |
Has anyone figured out a way around this besides downgrading react/react-native? |
Any updated here? |
you need react < 16, one fix would be to fork it and set dependency of react < 16. If your project is on react >= 16 I think that's what you'd have to do. |
@RealOrangeOne you should consider this
|
@RealOrangeOne Any fix for this issue ? Im using latest RN v51 & React 16. |
I have a pull request that fixes this #158 Once you have the updated package, you'll need to go into node_modules/react-native-mock and run |
I have the same issue 😕 |
@gabrielrotbart i'm trying to install your version of
Am I missing something here? Also, when will this be fixed officially in here :( |
I haven't encountered that, sorry. I'm away from my laptop on leave for two weeks so will have to have a look at it then. Hopefully the rewrite branch is ready by then anyway |
Any updates on this? |
you miss |
Encountered this just now and I am using flow. Could it be an issue with flow, I have the latest version of Flow, Jest and RN |
No, this library is no longer maintained and it doesn't work with React 15.5 and up because it uses deprecated React features. I recommend checking out https://github.com/mfncooper/mockery. |
Thanks @jdzak |
Actually, I just realized mockery is no longer maintained. Jest has mocking functionality built in, that's probably worth checking out. https://jestjs.io/docs/en/manual-mocks |
React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead use the following import PropTypes from 'prop-types'; Note: instead of using React.PropTypes.number use simply PropTypes.number |
I have an error with all my Views components
My deps:
The text was updated successfully, but these errors were encountered: