reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
dumrat 2020-10-24T05:20:26.086100Z

Hi

dumrat 2020-10-24T05:20:27.086300Z

Trying to integrate https://github.com/nadbm/react-datasheet into a re-frame project. `(defn main-panel []   (let [name (re-frame/subscribe [::subs/name])]     [:div      [:h1 "Hello from " @name]      [(r/adapt-react-class ReactDataSheet)       {:data [[{:val 1} {:val 2}] [{:val 3} {:val 4}]]        :valueRenderer #(:val %)}]]))` This results in: <div><h1>Hello from re-frame</h1><span tabindex="0" class="data-grid-container"><table class="data-grid"><tbody><tr><td class="cell"><span class="value-viewer"></span></td><td class="cell selected"><span class="value-viewer"></span></td></tr><tr><td class="cell"><span class="value-viewer"></span></td><td class="cell"><span class="value-viewer"></span></td></tr></tbody></table></span></div> So no data is visible. Am I doing something wrong?

p-himik 2020-10-24T08:46:08.086500Z

The :data value gets deeply converted into JS arrays and objects. The :valueRenderer function receives those JS objects and not CLJS maps. At least, that's how it seems after a minute of looking at your code.

p-himik 2020-10-24T08:46:08.086500Z

The :data value gets deeply converted into JS arrays and objects. The :valueRenderer function receives those JS objects and not CLJS maps. At least, that's how it seems after a minute of looking at your code.