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

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

javascript - react-router 4.0版本怎么實現(xiàn)以前onEnter的效果

瀏覽:119日期: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
相關文章:
主站蜘蛛池模板: 遂昌县| 柘荣县| 博乐市| 荆州市| 襄樊市| 汝城县| 隆化县| 长宁县| 昌江| 淳安县| 南平市| 成都市| 马龙县| 梅州市| 清丰县| 新疆| 苏尼特右旗| 云南省| 江口县| 布尔津县| 留坝县| 桐梓县| 伊宁县| 左贡县| 肃北| 康乐县| 府谷县| 岳池县| 阳谷县| 忻州市| 舒兰市| 鄱阳县| 临安市| 花莲市| 西宁市| 承德县| 益阳市| 剑河县| 秦皇岛市| 城口县| 疏勒县|