react-trello icon indicating copy to clipboard operation
react-trello copied to clipboard

Invalid Hook Call

Open rehanumar opened this issue 3 years ago • 6 comments

Describe the bug react-trello version 2.2.* is breaking the rules of hook with react and react-dom version 16.13.1`. App is crashing in this case.

To Reproduce Create a new project with react and react-dom version 16.13.1 and install react-trello. react-trello-bug-reproduce-repo

Expected behavior React-trello should not throw error and should render page properly.

Screenshots Screenshot

PS: I am not sure whether this is the right repo to discus this bug or I might need to post that with some upstream library of react-trello. I have search react-trello codebase from version 2.2.4 to 2.2.10. None of them were using hooks.

Context: Basically, everything was working correctly on my local computer. Until I deleted the node_modules and re installed the version 2.2.10 of react-trello to replicate this issue happening on staging.

rehanumar avatar Jun 24 '21 07:06 rehanumar

@dapi @rcdexta this issue still persists - any updates as to when can it be fixed?

EDIT:

Upon further investigation, if react and react-dom are upgraded to 17.0.2 the library works as expected. On 16.10.2 I was experiencing the same issues as described above.

urosran avatar Nov 03 '21 10:11 urosran

Issue still persists at 17.0.2 unaware of how to solve it

Mohamed-Ayaan358 avatar Dec 05 '21 14:12 Mohamed-Ayaan358

Make sure your react dependency is the same as react-dom, ex:

package.json:

    "react": "17.0.2",
    "react-dom": "17.0.2",

marciok avatar Dec 21 '21 01:12 marciok

I get the same error. Is there any way to resolve this? "react": "^17.0.2", "react-dom": "^17.0.2" And latest version of react-trello. NOTE: This does not happen if the version is belowe 2.2.0

kocka996 avatar Apr 26 '22 11:04 kocka996

Does anyone know a solution for this?

Still happening with react and react DOM 18.1.0

cocoshetuwu avatar Jun 21 '22 19:06 cocoshetuwu

I was able to resolve a similar error by forcing react-trello to use a pre-v6 version of styled-components. Basically, throwing this into package.json:

  "resolutions": {
    "react-trello/**/styled-components": "5.3.11"
  }

I'm not 100% convinced this is the same problem as encountered above, but maybe it will help someone else who runs across this issue.

lucioperca avatar Sep 02 '23 00:09 lucioperca