1.当我在,我的组件中引入useNavigate,并引用时报错
React Hook "useNavigate" is called in function "login" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
2.对应的翻译是
React Hook“useNavigate”在函数“login”中被调用,它既不是React函数组件,也不是自定义React Hook函数。React组件名称必须以大写字母开头。React钩子名称必须以“use”开头
3.react自定义的两种组件为函数组件和类组件名称首写字母都是需要大写的
4所以解决这个问题的办法就是login改为Login