diff --git a/doc/InteropWithReact.md b/doc/InteropWithReact.md index e1e1d70..14afc97 100644 --- a/doc/InteropWithReact.md +++ b/doc/InteropWithReact.md @@ -191,3 +191,4 @@ to always put the call at the top, as in `my-div` here: - [Material-UI](../examples/material-ui/src/example/core.cljs) - [React-sortable-hoc](../examples/react-sortable-hoc/src/example/core.cljs) +- [React-transition-group](../examples/react-transition-group/src/example/core.cljs) diff --git a/examples/react-transition-group/project.clj b/examples/react-transition-group/project.clj new file mode 100644 index 0000000..98d9a10 --- /dev/null +++ b/examples/react-transition-group/project.clj @@ -0,0 +1,28 @@ +(defproject reagent/react-sortable-hoc-example "0.1.0" + :dependencies [[org.clojure/clojure "1.10.1"] + [org.clojure/clojurescript "1.10.597"] + [reagent "0.10.0"] + [figwheel "0.5.19"] + [cljsjs/react-transition-group "4.3.0-0"]] + + :plugins [[lein-cljsbuild "1.1.7"] + [lein-figwheel "0.5.19"]] + + :figwheel {:repl false + :http-server-root "public"} + + :profiles {:dev {:resource-paths ["target/cljsbuild/client" "target/cljsbuild/client-npm"]}} + + :cljsbuild + {:builds + {:client + {:source-paths ["src"] + :figwheel true + :compiler {:parallel-build true + :source-map true + :optimizations :none + :main "example.core" + :output-dir "target/cljsbuild/client/public/js/out" + :output-to "target/cljsbuild/client/public/js/main.js" + :asset-path "js/out" + :npm-deps false}}}}) diff --git a/examples/react-transition-group/resources/public/fade.css b/examples/react-transition-group/resources/public/fade.css new file mode 100644 index 0000000..f21a371 --- /dev/null +++ b/examples/react-transition-group/resources/public/fade.css @@ -0,0 +1,21 @@ +.hide { + opacity: 0.01; +} + +.fade-enter { + opacity: 0.01; +} + +.fade-enter.fade-enter-active { + opacity: 1; + transition: opacity 500ms ease-in; +} + +.fade-exit { + opacity: 1; +} + +.fade-exit.fade-exit-active { + opacity: 0.01; + transition: opacity 300ms ease-in; +} diff --git a/examples/react-transition-group/resources/public/index.html b/examples/react-transition-group/resources/public/index.html new file mode 100644 index 0000000..9aff66e --- /dev/null +++ b/examples/react-transition-group/resources/public/index.html @@ -0,0 +1,14 @@ + + +
+ +