Answer the question
In order to leave comments, you need to log in
How to pass object to child component?
I'm using React in an angular app with ngreact.
The component structure is as follows:
<Parent>
<Child1>
<Child1.1></Child1.1>
<Child1.2></Child1.2>
</Child1>
<Child2>
<Child2.1></Child2.1>
<Child2.2></Child2.2>
</Child2>
</Parent>
$scope. someVar = {someData: dataFromresolve};
<react-component props="someVar" name="Parent"/>
...
render: function () {
return (
<Child1 someProps={this.props.someData}></Child1>
);
}
...
Answer the question
In order to leave comments, you need to log in
You are trying to render React child as an object somewhere, something like this:
let data = {'a': <div>1</div>,'b':<div>2</div>}
<li>{data}</li>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question