Not reviewed yet: this page may be outdated or inconsistent with the other guides. The API reference is generated from the current source.

Upgrading to 1.1

Declare the React dependency yourself

Reagent no longer depends on the Cljsjs React packages and no longer has a deps.cljs file with React npm dependencies. Your project has to declare the React dependency itself, using the method you choose.

With npm (e.g. shadow-cljs):

npm i react@17.0.2 react-dom@17.0.2

With Cljsjs packages (e.g. Leiningen and cljsbuild), add these to your dependencies:

[cljsjs/react "17.0.2-0"]
[cljsjs/react-dom "17.0.2-0"]

Add [cljsjs/react-dom-server "17.0.2-0"] too if you use reagent.dom.server: with React 17 the package is empty, but it provides the react-dom/server name that reagent.dom.server requires.

Other changes

  • Reagent no longer logs an extra "Error rendering component" message when a component throws during render: React already logs these errors.
  • reaction macro is now also available in reagent.core.
  • New :parse-tag option for create-compiler customizes how the Hiccup tag keywords are parsed, e.g. class names.