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

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

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

瀏覽:141日期: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
相關文章:
主站蜘蛛池模板: 嘉定区| 伽师县| 孟津县| 精河县| 达拉特旗| 武强县| 根河市| 安宁市| 伊春市| 临洮县| 木兰县| 华坪县| 永清县| 临清市| 中卫市| 和顺县| 新蔡县| 安多县| 澜沧| 营口市| 屯留县| 砀山县| 屏南县| 徐闻县| 桑植县| 潼南县| 柘城县| 莱西市| 广饶县| 阿拉尔市| 手游| 宜州市| 汝城县| 双鸭山市| 邮箱| 红安县| 抚宁县| 嘉禾县| 隆尧县| 阜宁县| 北京市|