在构建ZSim时发生以下错误,我不知道这是否是由于我的GCC版本或其他原因引起的。 我正在使用ubuntu14.04 gcc 4.8.4
// Engine.
class Engine extends React.Component {
// Get Info.
getInfo(count: number) {
console.log("Info Count:", count);
}
// Render.
render = () => <div>Engine</div>;
}
// Wizard.
export class Wizard extends React.Component {
// Active Element.
activeElement: Engine | null = null;
// Top Level Get Info.
topLevelGetInfo() {
const { activeElement } = this;
if (activeElement) activeElement.getInfo(10);
}
// Handle Ref.
handleRef = (el: Engine | null) => (this.activeElement = el);
// Render.
render() {
return (
<div>
Wizard.
<Engine ref={this.handleRef} />
</div>
);
}
// Did Mount.
componentDidMount() {
console.log("Mounting Wizard.");
this.topLevelGetInfo();
}
}