Hi,
I'm working with TreeView using nodeTemplate function to indicate a customComponent, this custom component has more compoments that are connnected to redux store.
The customComponent works with no problem in others view/screens but when a try to use it in the TreeView with nodeTemplate, this fails, For example if a click Edit option that the edit component user redux appears the following error:
Uncaught Invariant Violation: Could not find "store" in the context of "Connect(CardInfoEditor)". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to Connect(CardInfoEditor) in connect options.
Do you have an example with redux for treeView or any advice?
Note: The Redux store, is using in a internal component from the customComponet used with nodeTemplate.
getCardTemplate(data){
return (<ItemCard cardInfo={data} />);
}
<TreeViewComponent ref="refTreeView" id={'tree-column-'+this.state.column.id}
fields={this.state.fields} nodeTemplate={this.getCardTemplate} />
);
}
Examples:
class ItemCard extends React.Component {
<CardInfoEditor data={this.props.cardInfo} />
);
}
}
class CardInfoEditor extends React.Component {
render() {
return (
<div>{this.props.data.title}div>
).
}
export default withStyles(styles)(connect(null, null)(CardInfoEditor));
Thanks