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

undefined is not an object(evaluating 'ViewPropTypes.style') #14032

Closed
dalufine opened this issue May 18, 2017 · 30 comments
Closed

undefined is not an object(evaluating 'ViewPropTypes.style') #14032

dalufine opened this issue May 18, 2017 · 30 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@dalufine
Copy link

Description

When i clone a project from git, after 'npm install' react-native run-ios,the error coming.But others in team can run success.

Reproduction Steps and Sample Code

Additional Information

react-native-cli: 2.0.1
react-native: 0.42.3
@chetankothari
Copy link

Facing the same issue, how did you end up solving it. Stuck with it for quite some time now.

@chetankothari
Copy link

Sorry, this is not related to React Native. The problem was with a version of @expo/ex-navigation. Link to the issue.

@kevineaton
Copy link

I have this issue and I do not use expo nor do I see any expo dependencies. I am using Native Base and a few other libraries. Everything was running fine and then I tried to update a library and now I get this error. I reverted and even did a full git checkout of the repo before the attempted upgrade and now I get this anytime I try to run the application.

@v7
Copy link

v7 commented May 24, 2017

@kevineaton same problem with me did u found any solution?

@virgil9306
Copy link

virgil9306 commented May 24, 2017

@77ukhtar Check out react-navigation/react-navigation#1352 , seems to have a (temporary) workaround from @chenyi5266 . The fixes haven't been merged yet into master ( https://github.com/react-native-training/react-native-elements/pull/384 )

I personally have not seen this on Windows w/building for Android (latest Android Studio & updates) but I have seen this on Mac for iOS (latest updates)

@v7
Copy link

v7 commented May 24, 2017

@virgil9306 thanks, i will just not use nativebase on this project till it fixed

@shadman264
Copy link

shadman264 commented May 25, 2017

having the same problem after pulling project from git with android on both Windows & ubuntu 14.04. Can anyone provide any working solution?

@JulioOrellana
Copy link

still no solution to this? I am desperate about finding about this bug :/

@v7
Copy link

v7 commented May 29, 2017

@kevineaton I solved the error by updating native-base from 2.1.2 to 2.1.4 and react-native from 0.43.4 to 0.44.0

@JulioOrellana
Copy link

@77ukhtar you are the true hero here! works for me!

@olowe
Copy link

olowe commented May 29, 2017

Hi @kevineaton @77ukhtar I updated native-base from 2.1.2 to 2.1.4 and react-native from 0.43.4 to 0.44.0. But then I'm getting an error: DeviceInfo native module is not installed correctly...Help please? Thanks

@shadman264
Copy link

Update React-Native to 0.44.0 in package.json
Then run the following commands:

  1. sudo rm -rf node_modules && npm install
  2. sudo rm -fr $TMPDIR/react-*

@olowe
Copy link

olowe commented May 29, 2017

Okay @shadman264. Let me try this real quick. Thanks

@olowe
Copy link

olowe commented May 29, 2017

Yes! @shadman264 your solution works! Thanks!!!

@suark
Copy link

suark commented May 29, 2017

I'm getting this problem but on react-native 0.42.3. I don't have the option of upgrading react-native because then a bunch of other libraries break due to the react peer dependency upgrade. Hoping for other ideas

@mtx62
Copy link

mtx62 commented May 29, 2017

Greetings
I follow this upgrading page
https://facebook.github.io/react-native/docs/upgrading.html

and it's working fine

@anthonied
Copy link

Same as suark, I'm using react-native-maps. Can't upgrade.

@m-lg
Copy link

m-lg commented May 30, 2017

@shadman264 Thanks for the tip, you're a life saver 👍
worked for me after I specified the version in the package.json for the dependencies I didn't wan't to update (and created this mess in the first place when they got updated :'( )

@huozhenwei
Copy link

I have had the same problem
If you use a third-party component, change ViewPropTypes.style to View.propTypes.style

@haifaGh
Copy link

haifaGh commented Jul 2, 2017

guys i'm having the same problem and i can't upgrade since i have other dependencies .. so what should i do ? thanks
screen shot 2017-07-02 at 21 12 32

@huyunbo
Copy link

huyunbo commented Aug 8, 2017

我只是拉一个分支,开发新项目,分支是没问题,要怎么解决

@martianmartian
Copy link

martianmartian commented Aug 17, 2017

So i had the same problem. it's quite newbie problem in fact.
react-native link doesn't work.
for ios you have to manually link the xcodeproj thing to your project.(not sure about the android version yet)
here's a good tutorial for getting over this problem.
https://blog.nativebase.io/adding-third-party-native-modules-using-react-native-cbcb9e3786ba
it had little to do with version and other bs...

@cinder92
Copy link

for those that have same issue after install this package try this.

in file node_modules/react-native-maps/lib/components/MapView.js

in line 63

replace : style: ViewPropTypes.style
for : style: PropTypes.style

it fix my issue :)

@Jason8Zhang
Copy link

Jason8Zhang commented Oct 28, 2017

I am a newer for RN. This problem has bothered me a few days.

@harish-aka-shivi
Copy link

I was having the same issue. So I updated the RN and change from
import React, { Component, PropTypes } from 'react'
to
import React, { Component } from 'react'
import PropTypes from 'prop-types';

@samthui
Copy link

samthui commented Nov 24, 2017

I only had to update RN from 0.43.4 to 0.44.0.
Many thanks to @77ukhtar, @shadman264.

@guitar9
Copy link

guitar9 commented Jan 15, 2018

i have the same issue somebody knows how to solve?

@zibs
Copy link

zibs commented Jan 25, 2018

@gitarre94 depends on your RN version.

~ >0.45 you must use ViewPropStyles.style - even in third party packages. You'll have to go through and upgrade or fork to remove all references to View.propTypes.style
~ <0.45 you can use View.propTypes.style but you might not have access to ViewPropStyles.style

@husnaingoldev
Copy link

for those who are still unable to figure out, try following

import ViewPropTypes from 'react-native'

and then replace View.propTypes with ViewPropTypes

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests