This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-30
Channels
- # aleph (39)
- # announcements (5)
- # babashka (7)
- # beginners (14)
- # biff (1)
- # clj-kondo (7)
- # clojure (38)
- # clojure-chicago (3)
- # clojure-europe (3)
- # clojure-norway (1)
- # clojurescript (8)
- # cursive (17)
- # data-science (6)
- # defnpodcast (3)
- # emacs (4)
- # figwheel-main (1)
- # honeysql (2)
- # hyperfiddle (2)
- # malli (20)
- # missionary (24)
- # off-topic (27)
- # reagent (4)
- # scittle (11)
- # shadow-cljs (51)
- # spacemacs (1)
- # xtdb (2)
Hi, guys. Is there any problem in using r/create-element
with SortableTree
? I am got stuck with it.
Code:
(ns
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [reagent.core :as r]
[reagent.dom :as dom]
["@nosferatu500/react-sortable-tree" :as rt]
[cljs-http.client :as http]
[cljs.core.async :refer [<!]]))
(defn root-component []
(r/create-element rt/SortableTree
#js {:treeData [{:title "Chicken"
:children [{:title "Egg"}]}
{:title "Fish"
:children [{:title "fingerline"}]}
]
:onChange (constantly "hi")}
))
Compile Exception:
Closure compilation failed with 5 errors
--- node_modules/@nosferatu500/react-sortable-tree/index.js:1760
ES6 transpilation of 'Public class fields' is not yet implemented.
--- node_modules/@nosferatu500/react-sortable-tree/index.js:1782
ES6 transpilation of 'Public class fields' is not yet implemented.
--- node_modules/@nosferatu500/react-sortable-tree/index.js:1825
ES6 transpilation of 'Public class fields' is not yet implemented.
--- node_modules/@nosferatu500/react-sortable-tree/index.js:1881
ES6 transpilation of 'Public class fields' is not yet implemented.
--- node_modules/@nosferatu500/react-sortable-tree/index.js:1884
ES6 transpilation of 'Public class fields' is not yet implemented.
To quit, type: :cljs/quit
[:selected :frontend]shadow.user>
cljs.user>
This is the origin JS code:
import React, { Component } from 'react';
import SortableTree from 'react-sortable-tree';
import 'react-sortable-tree/style.css'; // This only needs to be imported once in your app
export default class Tree extends Component {
constructor(props) {
super(props);
this.state = {
treeData: [
{ title: 'Chicken', children: [{ title: 'Egg' }] },
{ title: 'Fish', children: [{ title: 'fingerline' }] },
],
};
}
render() {
return (
<div style={{ height: 400 }}>
<SortableTree
treeData={this.state.treeData}
onChange={treeData => this.setState({ treeData })}
/>
</div>
);
}
}