1

Trying to add a ReactRootView to my existing layout which looks like this

ReactRootView contentView = new ReactRootView(context);
LinearLayout container = (LinearLayout) parent.findViewById(R.id.view_container);
contentView.startReactApplication(reactInstanceManager, "MyComponent", null)
container.addView(contentView, -1, new LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));

With the above setup, my reactview never gets rendered, since the height is always 0. I have to explicitly provide the height to my layout as -

container.addView(contentView, -1, new LinearLayout.LayoutParams(MATCH_PARENT, 200));

How does ReactRootView handles the layout params when embedded inside a android native app ?

PS: Apologies for cross post did try to raise this issue here : https://github.com/facebook/react-native/issues/13476

duskandawn
  • 646
  • 1
  • 10
  • 19
  • 1
    Did you find out @duskandawn ? I'm having exactly the same issue, and I'm not seeing my ReactRootView. – SudoPlz Feb 12 '18 at 22:52
  • I had to do something like this ```new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT))``` for it to show up – duskandawn Feb 13 '18 at 20:25

0 Answers0