React - Error when using hook inside a function
问题 When using the npm package " use-dark-mode " I try to apply the hook const darkMode = useDarkMode (false); inside a function but i get an error Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: before giving you the code, I want to explain in more detail, I think you already understood from the package name, I want to use dark mode in my project, I have a lot of components, I pass the dark mode