I am expecting to render different component's based upon flag value and components need to be rendor outside the pivotitem tag.
class App extends Component<any, any> {
constructor(props: any) {
super(props);
this.state = {
isflag: true
};
}
render() {
return (
<div>
<Pivot aria-label="Basic Pivot Example">
<PivotItem headerText={this.state.NumberofSupportRequests} onClick={() => this.setState({ isflag: true })} >
</PivotItem>
<PivotItem headerText={this.state.MeanTimetoResolution} onClick={() => this.setState({ isflag: false })}>
</PivotItem>
</Pivot>
<div className="ms-Grid-row">
{this.state.isflag ? <component1 /> : <component2 />}
</div>
</div>
);
}
}
export default App;