Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以调用组件的特定方法?window.Component.method不起作用... 任何帮助表示赞赏,在此先感谢。
window.Component.method
var testClass = React.createClass({ handleClick: function(){ alert('you clicked me'); }, render: function(){ <button onClick={this.handleClick}></button> } });
不知道这是否是特定于铁路的东西,但如果它只是反应组件你的意思,这应该可以解决问题