child component
export default class Example extends React.Component<ICState,{sData,cData}> {
constructor(props,state:ICState) {
super(props);
sp.setup({
context: this.props.cData
});
this.state = {
arr:[]
};
}
}
Parent Component
<Example sData="someData" cData={this.props.context}/>
If i use State for the child component along with sData and cData i am unable to use child state ICState. Could anyone please let me know where i am going wrong?
Error Message in Parent component
Type '{ sData: any; cData: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'. Property 'sData' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'