React-native: warning: Calling of `[-RCTUIManager setFrame:forView:]` which is deprecated

Created on 8 Mar 2017  Â·  26Comments  Â·  Source: facebook/react-native

Description

After I upgrade RN from 0.38 to 0.42.0 I get this waring:

Calling of `[-RCTUIManager setFrame:forView:]` which is deprecated

Reproduction

Just after I upgrade RN, I got this warning. In remote debug mode. I only test in iOS platform.

Solution

[empty here]

Additional Information

  • React Native version: 0.42.0
  • Platform: IOS
  • Operating System: MacOS - Xcode 8.2.1
iOS Locked

Most helpful comment

Version bumped, new package is getting deployed. I am going to close that issue, please update to 0.42.2 when it gets released to npm (next hour).

Apologies for incovnience caused.

All 26 comments

same warning here

yes , same warning here . and the de Modal is not working 。

@jacobcyl : I guess something was changed recently in v0.42.0. Can you confirm that this is not occuring on v0.41.0?

Which Xcode version are you using?

@hramos I'm getting the same error with react-native v0.42 and XCode 8.2.1

@hramos as bennygenel

cc @mkonicek

Phew, I'm glad I'm not the only one -- I thought I broke something! For me, this started occurring after upgrading to 0.42, and Modals not working only happens when remote debugging is enabled. I also start to get strange crashes after trying to open Modals.

  1. Try to open modal. Nothing happens.
  2. Try to open other modal. Then:

screen shot 2017-03-09 at 09 15 09

  1. Try to open modal. Nothing happens.
  2. Navigate to other tab. Then:

screen shot 2017-03-09 at 09 15 32

Found same issue, maybe can be a related to remote js debugger, stopping it Modal is working for me.

I can confirm that when the debugger is closed, the Modal is working fine

Same issue here, SplashScreen hide stop working when remote js debugger is open.

Same issue. I upgraded from 0.41.2 to 0.42.0 and now the app runs fine when remote debugger is disabled. When it's enabled I get this warning: Calling of '[-RCTUIManager setFrame:forView:]' which is deprecated. and get a blank (white) screen.

(XCode 8.2.1)

UPDATE: Even though I'm not getting anything visually, I can see my code is running because in the remote debugger console I get console logs from my code.

Found same Issue

GitHub added reactions recently - if you are running into the same issue but have no additional data to provide, you can simply add a reaction to the original post at the top. One advantage of this is that it allows us to filter by issues with a large number of reactions, making it easier to identify issues that people care about the most. Thanks!

With the same problem when i upgraged rn to 0.42

same issue, blank screen after upgrading to 0.42

Quick git-blame-fu shows the warning was introduced in https://github.com/facebook/react-native/commit/f33f84e75f1957f381e34bc99a902b9c324db6fa by @shergin with the following description (abbreviated):

Deprecating/removing setFrame, setLeftTop, and co.

Summary:

  • _[...]_
  • Internally, setting frame only make sense to RootView, and in that case there we always must not change origin we are introducing setSize method.

Changes:

  • _[...]_
  • [-RCTUIManager setFrame:forView:] was deprecated, use (just introduced) setSize:forView: instead;
  • [-RCTUIManager setSize:forView:] was added.

If you are still need some of removed methods, you are probably doing something wrong. Consider using setIntrinsicContentSize-family methods,
setSize-family methods, or (in the worst case) accessing yogaNode directly.

Seems like some internal classes are still dependant on [-RCTUIManager setFrame:forView:]?

@Etheryte Thank you!

Nope, the internal classes do not depend on setFrame:forView:, the proof: https://github.com/facebook/react-native/search?utf8=%E2%9C%93&q=setFrame%3A.

Most likely, one of external native libraries still depends on [-RCTUIManager setFrame:forView:]. The fix should be pretty trivial though (see current deprecated implementation).

[-RCTUIManager setFrame:forView:] which is deprecated."
I changed the code,remind by Xcode to
[self setSize:frame.size forView:view];

@shergin I've found [-RCTUIManager setFrame:forView:] in two files of RN 0.42.1:

https://github.com/facebook/react-native/blob/v0.42.0/React/Views/RCTModalHostView.m
https://github.com/facebook/react-native/blob/v0.42.0/React/Base/RCTRootView.m

The method invocations have been removed completely in 0.43 only.

For those whose modals aren't working in debugger, check this out: https://github.com/facebook/react-native/pull/12744

If you want to make the changes yourself, go to your Libraries/ReactNative/YellowBox.js file in your node_modules and add this line const elevation = Platform.OS === 'android' ? Number.MAX_SAFE_INTEGER : undefined;, then change the 3 elevation: Number.MAX_VALUE in your styleSheet to elevation: elevation.

@binchik Oh, my fault. Branch cut splits my changes across versions. 😞 We have to cherry-pick https://github.com/facebook/react-native/commit/233015c93ee6f986cf1267f143fdfadbf9c6831d for 0.42.
@mkonicek Could you please help me with this?
Sorry about that. 😿

I've cherry picked 233015c93ee6f986cf1267f143fdfadbf9c6831d into 0.42-stable. We may still need to deploy a new package to npm. cc @ericnakagawa @grabbou

I'll investigate that as soon as I get home after Conf

On Tue, Mar 14, 2017, 11:34 Héctor Ramos notifications@github.com wrote:

I've cherry picked 233015c
https://github.com/facebook/react-native/commit/233015c93ee6f986cf1267f143fdfadbf9c6831d
into 0.42-stable. We may still need to deploy a new package to npm. cc
@ericnakagawa https://github.com/ericnakagawa @grabbou
https://github.com/grabbou

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/12777#issuecomment-286518137,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACWcxqLxKLle6fkcwYsnMIekUsl-uUbUks5rlt3BgaJpZM4MWTUt
.

Version bumped, new package is getting deployed. I am going to close that issue, please update to 0.42.2 when it gets released to npm (next hour).

Apologies for incovnience caused.

@jacobcyl can you please provide a solution to your template?

Was this page helpful?
0 / 5 - 0 ratings