Files
Victoria Drake de4dcd5d21 Go, roboto! Launch!! 🤖
2020-02-02 11:03:57 -05:00

22 lines
608 B
Clojure

(ns hello.world.clojurescript
(:require [reagent.core :as r])
(def counter (r/atom 0))
(def text-component-style {:background-color :grey
:border "1px solid black"
:padding "5px"})
(defn counter-clicked []
(.log js/console "You clicked the counter component.")
(swap! counter inc))
(defn text-counter [text]
[:div {:on-click counter-clicked
:style text-component-style})
(str text @counter])
(defn main-component []
[:div
[:p {:style {:color :red}} "Hello world! Click the element below:"]
[text-counter "Clicked: "]])