Create CljsjsReactProblems.md

This commit is contained in:
Juho Teperi 2018-03-24 22:36:09 +02:00 committed by GitHub
parent 1000672d76
commit e9f5c106e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Question
Reagent doesn't work after updating dependencies.
# Answer
If you see problems about accessing `React` or `ReactDOM` object or some React method after you have updated your dependencies,
Reagent or some other dependency which uses React. Problem is probably that you have `cljsjs/react` or `cljsjs/react-dom`
version which doesn't work with Reagent, or different version of React and ReactDOM, which don't work together.
To fix this you should check `lein deps :tree` or `boot show -d`, and check which version of Cljsjs React packages you have.
There are three alternative solutions:
1. Update all the packages that require Cljsjs React packages to use same (or compatible) versions as Reagent
2. Add `:exclusion [cljsjs/react cljsjs/react-dom]` to problematic dependencies, so only Reagent
will have transitive dependency on React packages
3. Add direct `cljsjs/react` and `cljsjs/react-dom` dependencies to your project, which will override any transitive dependencies
Note: `cljsjs/react-dom-server` package is deprecated but Reagent still depends on empty package for compatibility.
Note: For more information on how Leiningen and Boot resolve dependencies using Maven-resolver, read: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html