Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
export default class MasterComponent extends React.Component<MasterComponentProps, MasterComponentState> {
constructor()
{
super();
this._childSelect = this._childSelect.bind(this);
this.state= {
stateprop1 : null,
stateprop2 : true
}
}
public componentWillMount()
{
}
/**
* Get the value from the child control
* @param item
*/
private _childSelect(item : any)
{
this.setState({
selectObj : item
});
}
public render(): React.ReactElement<MasterComponentProps> {
return (
<div>
<div className="ms-Grid" dir="ltr">
<div className="ms-Grid-row">
<div className="ms-Grid-col ms-sm12 ms-md12 ms-lg12">
{/* This is a child control. Pass properties and get output values*/}
<ChildComponent context={this.props.context} childoutput={this._childSelect}> </ChildComponent>
</div>
</div>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.