国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

javascript - react-router 4.0版本怎么實現以前onEnter的效果

瀏覽:139日期:2023-02-18 15:49:01

問題描述

查看了官方文檔,好像并沒有說到這個

問題解答

回答1:

React Router v3 provides onEnter, onUpdate, and onLeave methods. These were essentially recreating React’s lifecycle methods.

With v4, you should use the lifecycle methods of the component rendered by a <Route>. Instead of onEnter, you would use componentDidMount or componentWillMount. Where you would use onUpdate, you can use componentDidUpdate or componentWillUpdate (or possibly componentWillReceiveProps). onLeave can be replaced with componentWillUnmount.

標簽: JavaScript
相關文章:
主站蜘蛛池模板: 广汉市| 齐齐哈尔市| 开江县| 锡林浩特市| 康保县| 民和| 静安区| 社旗县| 油尖旺区| 抚顺市| 青岛市| 石城县| 秭归县| 富阳市| 黔西| 阿克陶县| 武定县| 沁水县| 红桥区| 当阳市| 凤翔县| 石台县| 石楼县| 常熟市| 兴义市| 广宗县| 呼玛县| 周宁县| 思茅市| 普安县| 济南市| 资中县| 宁阳县| 高陵县| 陆川县| 宁都县| 紫金县| 颍上县| 商洛市| 衢州市| 遵义县|