It is still not working. The first render with Shadow-Cljs works but when the file gets saved, shadow-cljs reloads and reexecutes the file and then the result is:
45 | (rum/defc item [data]
46 | [:div.item
47 | [:div.picture (picture "https://t1p.de/adga")]
48 | [:div.title (:title data)]])
------------------------------^-------------------------------------------------
Use of undeclared Var projectname.core/data
--------------------------------------------------------------------------------
All I do, is the following in src/cljs/projectname.cljs
:
(ns projectname.core
(:require [rum.core :as rum]))
(def item_data
{:title "testitem"
:main-picture-url "https://t1p.de/adga"})
(rum/defc picture [url]
[:img {:src url :loading "lazy" :alt "Productpicture"}])
(rum/defc item [data]
[:div.item
[:div.picture (picture "https://t1p.de/adga")] ;;(:main-picture-url data))]
[:div.title (:title data)]])
(defonce item_comp (item item_data))
(rum/mount item_comp (js/document.getElementById "item-container"))
the defonce
is already a desperate attempt to fix this…