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

Setting RCTRootView.appProperties in Objective-C has no effect #15938

Closed
shaneosullivan opened this issue Sep 14, 2017 · 4 comments
Closed

Setting RCTRootView.appProperties in Objective-C has no effect #15938

shaneosullivan opened this issue Sep 14, 2017 · 4 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@shaneosullivan
Copy link
Contributor

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: 0.48.1
  2. node -v: v7.2.0
  3. npm -v:3.10.9
  4. yarn --version: 0.18.0

Then, specify:

  • Target Platform:
    iOS
  • Development Operating System:
    macOS 10.12.4
  • Build tools:
    XCode, issue is specific to iOS

Steps to Reproduce

Note: These are steps for using my example project. It's a long way of saying that setting the RCTRootView.appProperties has no effect, either in the viewDidLoad function or when I tried invoking it as the result of a NativeModule function call from JS. When debugging, the RCTRootView.m file was failing out at RCTAssertMainQueue(), but I don't know how to make that not fail.

  1. Check out the project at https://github.com/shaneosullivan/ReactNativeExampleBrowserExtension
  2. cd ReactNativeExampleBrowserExtension
  3. git checkout appPropertiesBug
  4. npm install
  5. In XCode, run the MyExampleExtension target.
  6. In the simulator, close the initial app that opened, as we are testing an Action Extension.
  7. Open Safari, go to some website like google.com
  8. Tap the Share icon, and scroll to the More... button. Tap that, find the "My Example Extension" button and toggle it to on.
  9. In the share menu, tap My Example Extension.

Expected Behavior

The React Native view should update to show the URL provided to it. See the code here that sets the appProperties: https://github.com/shaneosullivan/ReactNativeExampleBrowserExtension/compare/appPropertiesBug?expand=1#diff-0b1a9f46953a980a748dafea06f6543fR69

Actual Behavior

Nothing happens, the RN app is never re-rendered
simulator screen shot 13 sep 2017 21 44 31

Reproducible Demo

The 'appPropertiesBug' branch of https://github.com/shaneosullivan/ReactNativeExampleBrowserExtension/ shows this error, as noted above.

The line in question that executes (I checked with the XCode debugger) but has no effect is https://github.com/shaneosullivan/ReactNativeExampleBrowserExtension/compare/appPropertiesBug?expand=1#diff-0b1a9f46953a980a748dafea06f6543fR69

@notgiorgi
Copy link

@notgiorgi
Copy link

In my case, I think view is not re-rendered because _bridge.loading is true here:

https://github.com/facebook/react-native/blob/master/React/Base/RCTRootView.m#L339

don't know whether it's bug or not, but at least I want to know the way around it.

@shaneosullivan
Copy link
Contributor Author

@notgiorgi I worked around it by moving from using viewDidLoad to putting my code in loadView, so I got the information before rendering for the first time. The bug still remains as far as I know

@stale
Copy link

stale bot commented Dec 17, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 17, 2017
@stale stale bot closed this as completed Dec 24, 2017
@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants