- 博客(5)
- 收藏
- 关注
原创 TypeScript:try/catch踩坑:Object is of type ‘unknown‘
typescript :object is of type ‘unknown’
2022-10-03 17:22:17 2090 1
原创 Netlify部署出错:CI=true/page not found/Module not found
netlify部署react项目debug
2022-09-14 22:09:26 477
原创 React V6 编程式路由导航 useNavigate()要用函数式组件否则Hook报错
首先const navigate = useNavigate();则可以使用navigate这个函数代替this.history.push、this.history.replace、this.history.gofoward、this.history.goback、this.history.go1.注意:navigete默认history的是push模式,使用replace模式需要添加{replace:true} //开启replace模式2.注意:使用useNavigate()必须是在函数
2022-02-21 16:22:12 10879
原创 React-Router V6 params/research/state传参 函数式组件
V6版本中类组件中无法从props中接收到传递的参数解决方法:将类组件改为函数组件;使用useParams()和useLocation()接收参数;pages/Home/Messageimport React, { Component } from 'react'import { Link, Route, Routes,useParams } from 'react-router-dom'import Detail from './Detail'export default class
2022-02-21 13:25:50 1044
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人