📜  如何在类组件中使用 userouter - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:23.851000             🧑  作者: Mango

代码示例1
const MyClassWithRouter = (props) => {
  const router = useRouter()
  return 
}

class MyClass...
  constructor(props) {
    this.state = {
      loc: props.router.query.loc,
      loaded: false
    };
  }