[英]Render component inside a function react
class SurveyQuestion extends React.Component {
constructor(props) {
model.onComplete.add(function(result) {
return <TestEmpty message="test" />;
}
});
}
I am new to react, apologize if this is basic question, Is there any chance that if I could return component inside the constructor function, please? 我是新来的人,如果这是一个基本问题,我会道歉,请问是否有可能在构造函数中返回组件? When it is completed then return component. 完成后,返回组件。
I tried with my code, it is not working and no error message. 我尝试使用我的代码,它不起作用,也没有错误消息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.