Skip to content

Instantly share code, notes, and snippets.

@AsishP
Last active January 6, 2019 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AsishP/0ca31da4be48e95f1e31a4da4b4a747a to your computer and use it in GitHub Desktop.
Save AsishP/0ca31da4be48e95f1e31a4da4b4a747a to your computer and use it in GitHub Desktop.
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