react-navigation icon indicating copy to clipboard operation
react-navigation copied to clipboard

View.propTypes has been deprecated

Open sargunv opened this issue 9 years ago • 45 comments

I'm using React Native 0.44 with React Navigation 1.0.0-beta.9 and I'm getting the warning "View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead." when using a TabNavigator.

Relevant commit (I think): https://github.com/facebook/react-native/commit/53905a537a58d028fc5eb1c4e9a8ec967d8cd396

sargunv avatar May 03 '17 10:05 sargunv

Yep, seeing the same thing. I'm using

  • react-native : "0.44.0",
  • react-navigation : "^1.0.0-beta.9",

hdsenevi avatar May 04 '17 02:05 hdsenevi

very annoying...

JeremyZheng avatar May 04 '17 03:05 JeremyZheng

me too

tulin745 avatar May 04 '17 07:05 tulin745

I see this warning everywhere, many components that I use in react native throw it, and most of then don't even use View.propTypes at all (or even use a component that use it), Any ideas how this warning can be fixed? I'll be happy to explore the ideas and submit a PR here too.

brenordr avatar May 04 '17 12:05 brenordr

me too.

zhaiyjgithub avatar May 05 '17 02:05 zhaiyjgithub

same problem

ztplz avatar May 05 '17 08:05 ztplz

me too.

tslearn avatar May 05 '17 10:05 tslearn

强迫症的原因,有个警告很不舒服,所以找到了该文件,把他改掉就行。 目录:node_modules/react-native-tab-view/src/TabViewAnimated.js 第78行,的View.propTypes 改成 ViewPropTypes ,并且在第5行的导入中,增加ViewPropTypes的导入

replace View.propTypes to ViewPropTypes in file node_modules/react-native-tab-view/src/TabViewAnimated.js at line 78 , and import ViewPropTypes at line 5

cielu avatar May 05 '17 13:05 cielu

Getting really angry with React Navigation. NavigationExperimental has officially been removed in RN 0.44 and I can't even get an example project running properly by just running yarn add react-navigation. I have to specifically point it at that project's master. I guess my app is stuck at RN 0.43 because everything isn't ready to port. This is terrible.

keeleycarrigan avatar May 06 '17 21:05 keeleycarrigan

I have the same problem, and I would rather not have to modify files in node_module folder as it is usually not tracked.

laylafy avatar May 07 '17 11:05 laylafy

I know this is not a fix, but I didn't want to dismiss this warning all the time when I was testing so I ended up doing the following. Hope it helps someone.

console.ignoredYellowBox = ['Warning: View.propTypes'];

This will ignore that specific warning but would show any other warnings (if any)

hdsenevi avatar May 08 '17 00:05 hdsenevi

We're also seeing this warning.

    Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead.

[email protected] [email protected]

slonak79 avatar May 08 '17 21:05 slonak79

esta solución me funciono @cielu "replace View.propTypes to ViewPropTypes in file node_modules/react-native-tab-view/src/TabViewAnimated.js at line 78 , and import ViewPropTypes at line 5". tambien remplace en todos los archivos lo mismo, me guiaba con el stacktrace del warning. eso me indicaba donde remplazar. saludos

xavieracostapolo avatar May 09 '17 01:05 xavieracostapolo

Update this please

razki avatar May 09 '17 21:05 razki

Replace View.propTypes to ViewPropTypes in all plugins you used. That's how I fixed!

Lexiwu avatar May 10 '17 05:05 Lexiwu

Same problem for me

valleywood avatar May 10 '17 19:05 valleywood

+1

samstr avatar May 11 '17 22:05 samstr

I think this is something in react-native-tab-view. When I made my own tab view based off what is going on in that this warning went away. Not sure, but just noticed that.

keeleycarrigan avatar May 12 '17 00:05 keeleycarrigan

+1

larryranches avatar May 12 '17 14:05 larryranches

Should be released in 1.0.0-beta.10, as we've upgrade react-native-tab-view.

skevy avatar May 15 '17 15:05 skevy