久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

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

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

瀏覽:135日期: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
相關文章:
主站蜘蛛池模板: 寻乌县| 旬阳县| 彰武县| 当涂县| 崇文区| 丹江口市| 措美县| 达日县| 桂林市| 静宁县| 弥勒县| 新宁县| 宁城县| 潞城市| 商洛市| 绥棱县| 上饶县| 延边| 长泰县| 黎平县| 海淀区| 大名县| 濮阳县| 会宁县| 克什克腾旗| 娄烦县| 壶关县| 大名县| 阿城市| 连云港市| 沙洋县| 临桂县| 资溪县| 永丰县| 灌南县| 宜兰市| 澄江县| 徐闻县| 沂源县| 临汾市| 新田县|