react-trello
react-trello copied to clipboard
Invalid Hook Call
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
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.
@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.
Issue still persists at 17.0.2 unaware of how to solve it
Make sure your react
dependency is the same as react-dom
, ex:
package.json:
"react": "17.0.2",
"react-dom": "17.0.2",
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
Does anyone know a solution for this?
Still happening with react and react DOM 18.1.0
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.