class TicketTabDetails extends Component {
constructor () {
super();
}
render () {
console.log(this.props.ticketItem);
let detailedContent = (
<Section pad="medium">
{this.props.ticketItem}
</Section>
);
return detailedContent;
}
}
class TicketTabData extends Component {
constructor (props) {
super(props);
this.onFetchTabData = this.onFetchTabData.bind(this);
this.state = {
ticketdata : ''
}
}
onFetchTabData(tabdata) {
this.setState({ ticketdata: tabdata });
}
render () {
return (
<Split flex="right">
<Sidebar colorIndex="light-2">
<BuildSideMenu menuitem={this.props.branch} onFetchTabData = {this.onFetchTabData}/>
</Sidebar>
<Article scrollable={true}>
<TicketTabDetails ticketItem={this.state.ticketdata}/>
</Article>
</Split>
);
}
}
此类TicketTabDetails无法返回作为属性传递的更新的ticketItem,如果属性值更改,如何更新视图?