This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-06
Channels
- # aleph (15)
- # announcements (2)
- # babashka (121)
- # beginners (62)
- # biff (6)
- # cherry (2)
- # cider (51)
- # clerk (30)
- # cljs-dev (5)
- # clojure (77)
- # clojure-austin (2)
- # clojure-europe (10)
- # clojure-germany (6)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-romania (1)
- # clojure-uk (3)
- # clojurescript (16)
- # core-typed (7)
- # cursive (17)
- # datomic (12)
- # deps-new (11)
- # emacs (7)
- # events (2)
- # fulcro (5)
- # honeysql (2)
- # hyperfiddle (32)
- # introduce-yourself (1)
- # jobs-discuss (2)
- # membrane (18)
- # missionary (2)
- # music (5)
- # polylith (7)
- # reagent (26)
- # releases (5)
- # testing (32)
- # tools-build (14)
- # tools-deps (7)
- # xtdb (8)
Hello, I trying to implement an react table component but its not working. Whats wrong here? I using reagent, hyperfiddle electric.
#?(:cljs ["react-data-table-component" :refer [DataTable]]) ;;--> is it correct?
(def columns
#js
[#js {:name "Title", :selector (fn [row] (.-title row))}
#js {:name "Year", :selector (fn [row] (.-year row))}])
(def data
#js
[#js {:id 1, :title "Beetlejuice", :year "1988"}
#js {:id 2, :title "Ghostbusters", :year "1984"}])
(defn MyComponent [] [:> DataTable {:columns columns, :data data}])
(e/defn Todo-list []
(e/client
(dom/text "hello!")
(with-reagent MyComponent)
))
https://react-data-table-component.netlify.app/?path=/docs/getting-started-examples--page this is my table components page
This is the example that I trying to implement
Component not appears on web page.What exactly does "not working" mean? No data, wrong data, white page, JS errors in your browser's JS console?
I seelng Hello text on screen but no any other component exist. I waiting a table component to see.
Does the JS console have any relevant messages?
Does "world" also show up on screen when you replace the body of MyComponent
with [:span "world"]
?
Check the render method of app.todo_list.MyComponent
. (console message) World is appearing but When I "defn" that into a variable and then call instead of myComponent
What if you replace the whole import with ["react-data-table-component$default" :as DataTable]
?
It worked thank you. Today I tried the same import but it didn't work. I guess I used clojurescript vector and map at that time.
["react-data-table-component$default" :as DataTable]
what are different between these two?
["react-data-table-component" :as DataTable]. <---- not working
( I tried that import )If you're using shadow-cljs, then it's documented here: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages