-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
View.propTypes has been deprecated #1352
Comments
Yep, seeing the same thing. I'm using
|
very annoying... |
me too |
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), |
me too. |
same problem |
me too. |
强迫症的原因,有个警告很不舒服,所以找到了该文件,把他改掉就行。 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 |
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 |
I have the same problem, and I would rather not have to modify files in node_module folder as it is usually not tracked. |
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.
This will ignore that specific warning but would show any other warnings (if any) |
We're also seeing this warning.
|
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 |
Update this please |
Replace View.propTypes to ViewPropTypes in all plugins you used. |
Same problem for me |
+1 |
I think this is something in |
+1 |
Should be released in 1.0.0-beta.10, as we've upgrade react-native-tab-view. |
in node_modules/react-native-tab-view/src and node_modules/react-native-tab-navigator all JS files which have "View.propTypes" , should import { ViewPropTypes } from 'react-native' and replace View.propTypes to ViewPropTypes |
Some problem |
This still seems to be present in 1.0.0-beta.11. |
Please solve this issue. |
Still seeing this warning with a tab navigator on 1.0.0-beta.11 |
me to |
Have you a concrete example ? |
Can it be that it is caused by According to the original repo, its latest version is 3.4.1 while the one in the package.json of this lib is 2.2.2. |
The cause is listed above by @cielu: The To fix this issue:
|
I hope it will be fixed quickly because it's really annoying! :) |
I think |
Has there been any progress with this? Updating to This has been open for a while and also marked as a bug, it would be great if we could get a fix out for this! |
+1 |
there is code mod to rename automatically |
I actually think that all the dependencies on this library have not been fixed and this issue doesn't come up anymore. In my case, I was still seeing the warning, but it was actually due to another library which is not brought in by React Navigation. In my case it was To see where it's coming from, take a look at the stack trace of the warning: As far as I can tell, this issue has been fixed for this library and should be closed. Someone, please correct me if I'm wrong, however! |
I can confirm that the latest version of react-navigation has fixed this issue 👍 If you're wanting to know what libraries you depend on that need upgraded: I was getting this warning within my jest tests, and I was able to work out which modules were failing via editing function reactConsoleErrorHandler() {
+ console.log(new Error().stack);
console._errorOriginal.apply(console, arguments);
if (!console.reportErrorsAsExceptions) {
return;
}
if (arguments[0] && arguments[0].stack) {
reportException(arguments[0], /* isFatal */ false);
} else {
... That way my tests output the stack containing the libraries that needed to be updated: console.log node_modules/react-native/Libraries/Core/ExceptionsManager.js:71
Error
at BufferedConsole.reactConsoleErrorHandler [as error] (/app/node_modules/react-native/Libraries/Core/ExceptionsManager.js:71:13)
at printWarning (/app/node_modules/fbjs/lib/warning.js:36:17)
at warning (/app/node_modules/fbjs/lib/warning.js:60:22)
at Function.get [as propTypes] (/app/node_modules/react-native/Libraries/Components/View/View.js:184:1)
at Object.<anonymous> (/app/node_modules/react-native-modal-datetime-picker/src/CustomDatePickerIOS/index.js:98:341)
^^^ This is the component that needs upgraded
at Runtime._execModule (/app/node_modules/jest-runtime/build/index.js:447:13)
at Runtime.requireModule (/app/node_modules/jest-runtime/build/index.js:295:14)
at Runtime.requireModuleOrMock (/app/node_modules/jest-runtime/build/index.js:365:19)
at Object.<anonymous> (/app/node_modules/react-native-modal-datetime-picker/src/index.js:3:26)
at Runtime._execModule (/app/node_modules/jest-runtime/build/index.js:447:13)
console.error node_modules/react-native/Libraries/Core/ExceptionsManager.js:72
Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead. In this case I had to upgrade |
Great! I think this issue should be closed in that case. For anyone still seeing the warning, use the method above from @AlanFoster to check where it's coming from. |
Excellent, thanks! |
ViewStylePropTypes must be used now. I changed them all manually and got it working but it gives me a lot of warnings. |
* fix: replaces View.propTypes with ViewPropTypes react-navigation/react-navigation#1352 * fix: lint
Use ViewPropTypes instead. View.propTypes is intended for DEV mode. So, when I'm using this awesome library, in DEV mode it works perfectly fine, but as soon as I build the release version, it crashes. Using react-native 0.50.0 with react 16.0.0. More info here: react-navigation/react-navigation#1352 facebook/react-native#16352
ViewPropTypes is not defined |
@ymz2012 you should change
to
|
How you remove View.propTypes.style. / how find which lib have the issue ? My project is working in simulator but not in real device. How i find which library have issue. "version": "0.0.1", |
@arunjkumarp - search in node_modules for it and remove. update libraries to latest |
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): facebook/react-native@53905a5
The text was updated successfully, but these errors were encountered: