0
组件渲染时react-router是否触发了一个事件?我没有在它的github wiki页面中找到它。
一个就是这样的事件在角UI路由器: $viewContentLoaded - fired once the view is loaded, after the DOM is rendered. The '$scope' of the view emits the event.
反应路由器呈现的事件
组件渲染时react-router是否触发了一个事件?我没有在它的github wiki页面中找到它。
一个就是这样的事件在角UI路由器: $viewContentLoaded - fired once the view is loaded, after the DOM is rendered. The '$scope' of the view emits the event.
反应路由器呈现的事件
使用componentDidMount
生命周期法,你是路由到组件上。
var YourComponent = React.createClass({
componentDidMount: function() {
// Code here
},
componentWillUnmount: function() {
},
render: function() {
return (
<div>
</div>
);
}
});
module.exports = YourComponent;
非常感谢。很棒! – ailionx