Fork me on GitHub
#reagent
<
2023-03-19
>
Clojuri0an02:03:02

(defn sample-component []
  [:div
   [:p "I am a component!"]
   [:p.someclass
    "I have" [:strong "bold"] "text."]])

(defn mountit []
  (r/render [sample-component]
             (.-body js/document)))

 (defn init []
   (println "Hello world")
   (sample-component)
   (mountit))
returns
Reagent.core/render function was moved to reagent.dom namespace in Reagent v1.0.
on build
reagent.core/render is deprecated    
halp

2
Clojuri0an02:03:58

Think I figured it out, was calling reagent.core instead of reagent.dom

Clojuri0an02:03:03

Error: Target container is not a DOM element.

Clojuri0an02:03:27

Figured out, needed an index.html of the form

<head>

      <title>
     title
  </title>
    </head>
  <body>
        <script src="./js/invoice-frontend.js"></script>
    </body>
  </html>

Clojuri0an04:03:26

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ['./src/main/invoice/frontend/*.{cljs}',
	      './invoices/invoice-frontend/js/*.{js}',],
  theme: {
    extend: {},
  },
  plugins: [],
}
seems to be unable to pull :class tags from in src/main/invoice/frontend/main.cljs. Anyone here using tailwind with cljs?

2
p-himik08:03:40

No clue whether these projects are relevant to your particular problem, but at least they're relevant to the question: • https://github.com/jacekschae/shadow-cljs-tailwindcsshttps://github.com/teknql/shadow-cljs-tailwind-jithttps://github.com/wilkerlucio/tailwind-garden Somewhat relevant: • https://github.com/green-coder/girouettehttps://github.com/mainej/headlessui-reagent

👍 4
Clojuri0an13:03:20

Thanks, was able to get it working by comparing my config to shadow-cljs-tailwindcss repo

👍 2