diff --git a/docs/0.8-upgrade.md b/docs/0.8-upgrade.md index 39798a1..1167121 100644 --- a/docs/0.8-upgrade.md +++ b/docs/0.8-upgrade.md @@ -12,6 +12,32 @@ if you have direct dependencies to them. If you use additional React packages, you need to update Cljsjs packages for these to use new React foreign-lib name, `react` instead of `cljsjs.react`. **Subject to change, if this can be solved easily.** +As a quick fix, you can add updated foreign-lib definition to your project, +like following example for react-leaflet, and update your project +to refer to the new name, and at the same time your can start using +`:global-exports`: + +```cljs +:foreign-libs [{:file "cljsjs/development/react-leaflet.inc.js" + :file-min "cljsjs/production/react-leaflet.min.inc.js" + :provides ["react-leaflet"] + :requires ["react"] + :global-exports {react-leaflet ReactLeaflet}}]}} +``` + +Old code: +```cljs +(ns ... (:require cljsjs.react-leaflet)) + +(def Map (r/adapt-react-class js/ReactLeaflet.Map)) +``` + +New code: +```cljs +(ns ... (:require [react-leaflet :as react-leaflet])) + +(def Map (r/adapt-react-class react-leaflet/Map)) +``` ## Browser - node modules