This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-15
Channels
- # adventofcode (110)
- # announcements (30)
- # aws (2)
- # babashka (39)
- # babashka-sci-dev (112)
- # beginners (155)
- # calva (5)
- # cider (12)
- # clj-kondo (11)
- # cljs-dev (1)
- # cljsrn (2)
- # clojure (144)
- # clojure-australia (2)
- # clojure-europe (14)
- # clojure-nl (5)
- # clojure-spec (3)
- # clojure-uk (2)
- # clojurescript (22)
- # core-async (23)
- # cursive (31)
- # data-science (3)
- # emacs (12)
- # events (1)
- # fulcro (8)
- # honeysql (7)
- # jobs-discuss (11)
- # lsp (1)
- # missionary (28)
- # nextjournal (7)
- # off-topic (64)
- # pedestal (3)
- # polylith (19)
- # reagent (14)
- # reitit (12)
- # releases (4)
- # shadow-cljs (33)
- # tools-deps (3)
- # xtdb (3)
e.g., The below map would get converted to a JS object and the value for :raw-data
would be the persistent map object, not a converted JS object.
{:option1 "a"
:raw-data ^:skip {}}
If it's for a React component, you should be able to use :r>
introduced here: https://github.com/reagent-project/reagent/issues/494
There's also related discussion here: https://github.com/reagent-project/reagent/issues/389
Hey everyone ! I need a rich text editor component: nothing too fancy, must just support basic bold/underline/italic as well as links and {un,}ordered lists. Could anyone share some advice, library names (or even better: code) for a rich text editor? I'd like to stay away from Quill (due to some bugs it seems to exhibit) and I'm trying Draft.js with inspiration from https://gist.github.com/nrfm/0c33d297e8ae5cf36c98ef640003a118 but the ClojureScript I'm producing is very JavaScript-y (so hard to read/understand), already a bit complicated and I can't get it to do what I want β¦
To answer my own question β just in case someone else wonders β I am going with Draft.js (authors are from Facebook so that should be a token of seriousness). Also note that after loosing precious time, I realized there are much appreciated β unofficial? β plugins so that you don't have to reinvent the wheel https://www.draft-js-plugins.com/ .
I'm working on extending react-select to use custom components built with Reagent. In their "https://react-select.com/components#defining-components" section, they have this bit: > When defining replacement components, it is important to do soΒ outsideΒ the scope of rendering the Select. Defining a replacement component directly in the components prop can cause issues. With the following bad and good example:
// Bad: Inline declaration will cause remounting issues
const BadSelect = props => (
<Select {...props} components={{
Control: ({ children, ...rest }) => (
<components.Control {...rest}>
π {children}
</components.Control>
)}}
/>
)
// Good: Custom component declared outside of the Select scope
const Control = props => ({ children, ...rest }) => (
<components.Control {...rest}>
π {children}
</components.Control>
);
const GoodSelect = props => <Select {...props} components={{ Control }} />
I'm not quite sure what the equivalent Reagent implementation of the above would be. Perhaps something like this?
(defn CustomControl
[{:keys [children] :as props}]
(into [:> (.-Option react-select/components) props] children))
[:> react-select/default {:components {:Control (r/reactify-component CustomControl)}}]