FredrikOseberg / react-chatbot-kit

MIT License
301 stars 141 forks source link

Failed to compile. | Hook issue #12

Closed savemyfiles closed 3 years ago

savemyfiles commented 3 years ago

Hi there,

Could you help me to understand why when i try to "yarn start" in the command prompt, I get this error message =

Failed to compile.

src\components\ChatBot\Chatbot.jsx

Line 50:29: React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks Line 55:23: React Hook "useRef" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks Line 57:3: React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks Line 61:3: React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks

Search for the keywords to learn more about each error.

I checked hooks documentation, but didn't find where the issue come from..

Thanks a lot

FredrikOseberg commented 3 years ago

Hmm. Do you have a github link?

søn. 25. okt. 2020 kl. 21:30 skrev antoinehr notifications@github.com:

Hi there,

I checked hooks documentation, but didn't find where the issue come from..

Could you help me to understand why when i try to "yarn start" in the command prompt, I get this error message 👍=

Failed to compile.

src\components\ChatBot\Chatbot.jsx

Line 50:29: React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks Line 55:23: React Hook "useRef" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks Line 57:3: React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks Line 61:3: React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks

Search for the keywords to learn more about each error.

Thanks a lot

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FredrikOseberg/react-chatbot-kit/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2WIPREWLY6Z56QGEFRP53SMSDF7ANCNFSM4S6SITAA .

savemyfiles commented 3 years ago

Well I don't for now, still working on. I'll try to restart from scratch, and try to get why this error came up..