infely / react-curse

A curses-like blazingly fast react renderer
147 stars 5 forks source link

useExit is not a hook #5

Closed andresmoschini closed 2 weeks ago

andresmoschini commented 5 months ago
image

In the example code, useExit is not following the rules of hooks. I think that it is ok because it is not a real hook, but in this case, it could be named differently.

After running ESLint with eslint-plugin-react-hooks, I am getting this error:

  27:9  error  React Hook "useExit" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function  react-hooks/rules-of-hooks

A possible workaround is to rename useExit in the import:

- import { Text, useExit, useInput } from "react-curse";
+ import { Text, useExit as exit, useInput } from "react-curse";
andresmoschini commented 4 months ago

😴💤💤💤