react-hybrid icon indicating copy to clipboard operation
react-hybrid copied to clipboard

UIView unable to render with custom parameters

Open billycrid opened this issue 6 years ago • 3 comments

Trying to pass custom parameters into a UIView using the render method as suggested here: https://github.com/ui-router/react/issues/26

<UIView render={(Component, props) => <Component {...props} {...someOtherProps} /> } />

seems that render is not actually working when using react-hybrid? is this a known issue

billycrid avatar May 11 '18 10:05 billycrid

Having same issue but not able to find where cause the problem...

from the doc

The component finds the state context by looking first via React props, and second via AngularJS DOM data. It then provides the state context to its children using React props.

So I guess it should get react props?

waitingduck avatar Jul 27 '18 04:07 waitingduck

Tried react context. Looks like it will also break the context, so it can only get default context but not value props in provider.

waitingduck avatar Sep 05 '18 06:09 waitingduck

So here is my finding about this.

  • Component wrapped in UIView here is actually going to copy context then make a stand alone component tree. so after render, parent component(containing UIView) and child component(inside UIView) is not in the same tree and so disconnected. That why <Context> isn't work here.

  • <UIView> only feed in state config and className(I guess) into component.

waitingduck avatar Sep 22 '18 03:09 waitingduck