This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-01
Channels
- # adventofcode (30)
- # announcements (51)
- # aws (27)
- # babashka (1)
- # beginners (16)
- # calva (6)
- # cider (10)
- # clj-kondo (2)
- # clojure (94)
- # clojure-dev (27)
- # clojure-italy (1)
- # clojure-taiwan (1)
- # clojure-uk (5)
- # clojurescript (18)
- # clojutre (2)
- # cursive (14)
- # data-science (8)
- # emacs (2)
- # joker (5)
- # off-topic (3)
- # shadow-cljs (31)
- # sql (2)
- # vim (2)
- # yada (11)
Im trying to use slatejs
with reagent
const App = () => {
const editor = useMemo(() => withReact(createEditor()), [])
// Define a rendering function based on the element passed to `props`. We use
// `useCallback` here to memoize the function for subsequent renders.
const renderElement = useCallback(props => {
switch (props.element.type) {
case 'code':
return
default:
return
}
}, [])
return (
{
if (event.key === '&') {
event.preventDefault()
editor.exec({ type: 'insert_text', text: 'and' })
}
}}
/>
)
}
const CodeElement = props => {
return (
{props.children}
)
}
const DefaultElement = props => {
return {props.children}
}
CLJ version
(defn codeElem [props]
[:pre (.-attributes props) [:code (.-children props)]])
(defn default [props]
[:p (merge nil (:attributes props)) (:children props)])
(defn renderElem [props]
(r/create-element
(r/reactify-component
(if (= (-> props .-element .-type) "code") codeElem default))
props))
(defn editor-panel []
(let [ed (withReact (createEditor))]
(fn []
[:div#editor
[:> Slate {:editor ed :defaultValue defaultValue}
[:> Editable
{:onKeyDown #(println (.-key %))
:renderElement renderElem}]]])))
But getting strange errors on console, how can I convert that to reagent?Hey all, I am just curious if there is CLJS refactor support for emacs in someway? Poking around it doesn't seem like that is the case.
there isn't to my knowledge. clojure-lsp handles this just fine however. https://github.com/snoe/clojure-lsp
Hi everyone! 👋 I'm following the quick start tut (https://clojurescript.org/guides/quick-start), but I'm not getting a REPL when running clj --main cljs.main --compile hello-world.core --repl
. It downloaded all the deps, opened the browser, and printed Hello world!
in the terminal, but some minutes later it still hasn't showed a REPL prompt.
This did it (from http://clojure.2344290.n4.nabble.com/I-did-the-Clojurescript-quickstart-repl-prompt-never-shows-up-tp18363p18364.html): clj --main cljs.main --compile hello-world.core --repl --repl-opts "{:launch-browser false}"