setNativeProps is deprecated. Please update props using React state instead.

Warning: setNativeProps is deprecated. Please update props using React state instead.
I develop my apps with expo using React 18, but get the above deprecation warning, though my app still runs.
I’d be most grateful if anyone could help me with a solution that could make it go away.

Hi @dannyogbuagu

Are you calling “setNativeProps” in your code?

This page might help explain the background:

Thanks.
To answer your question, I’m not making call to “setNativeProps” in my code.
I suspect that such a call must have been made somewhere in the internals of expo. I’m still using the managed option for developing with expo.

It’s probably in one of your dependencies. Could you post your dependencies and devDependencies from package.json?

EDIT: Here’s some more info on this:

From this it seems that this deprecation is to do with the “new architecture”, so it is not relevant if you are not using the new architecture. You are not using the new architecture, so this warning should be safe to ignore.

Also, since you are not the one calling setNativeProps, it must be one of your dependencies that is doing that. So it would be their responsibility to switch to a different solution. At some point in the future, you would probably need to upgrade this dependency, but it’s probably not something you need to worry about until you want to upgrade to a version of the Expo SDK that enables the new architecture by default. Maybe that will be Expo SDK 47, or maybe a later version.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.