Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Minimal Reagent Project
(ns min-reagent.core
(:require
[reagent.core :as r]))
(defn my-app []
[:div
[:h1 "Hello Reagent"]
[:p "ClojureScript + React + Atoms + Hiccup"]])
(r/render
[my-app]
(js/document.getElementById "appdiv"))
.
├── project.clj
├── resources
│   └── public
│   └── index.html
└── src
└── min_reagent
└── core.cljs
<html>
<body>
<div id="appdiv"></div>
<script src="js/out/goog/base.js"></script>
<script src="js/main.js"></script>
<script>goog.require('min_reagent.core')</script>
</body>
</html>
(defproject min-reagent "0.0.1"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.293"]
[reagent "0.6.0"]]
:plugins [[lein-cljsbuild "1.1.4"]
[lein-figwheel "0.5.7"]]
:cljsbuild
{:builds
{:dev {:source-paths ["src"]
:figwheel true
:compiler {:output-to "resources/public/js/main.js"
:output-dir "resources/public/js/out/"}}}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment