Skip to content

Instantly share code, notes, and snippets.

@zehnpaard
Created November 10, 2016 22:26
Show Gist options
  • Save zehnpaard/6aa2956b1509335e34a5cf35b88d1dc2 to your computer and use it in GitHub Desktop.
Save zehnpaard/6aa2956b1509335e34a5cf35b88d1dc2 to your computer and use it in GitHub Desktop.
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