Questions tagged [reagent]

Reagent provides a minimalistic interface between ClojureScript and React.

It allows you to define efficient React components using nothing but plain ClojureScript functions and data, that describe your UI using a Hiccup-like syntax.

342 questions
4
votes
1 answer

Clojurescript Semantic UI React Search custom renderer

I am trying to implement a search in Clojurescript with reagent/re-frame and semantic-ui. Semantic-ui uses a renderer for the suggestions. This renderer defaults to image, price, title, description. As I want to have suggestions on geocoding I want…
Timo
  • 320
  • 3
  • 14
4
votes
2 answers

include foreign libs in clojurescript project

I am trying to use react-beautiful-dnd in my new ClojureScript and Reagent application. As per the blog here, it says that I need to include the file using :foreign-libs in my project.clj file. I have configured it as below :cljsbuild {:builds…
S4beR
  • 1,872
  • 1
  • 17
  • 33
4
votes
0 answers

CSS Modules in reagent and/or om

While this is probably a very silly question, is there a canonical way to use css modules in either Reagent or Om components? By this I mean CSS written in a separate file in SCSS or CSS without writing styling in EDN like garden.
Ethan McCue
  • 883
  • 1
  • 8
  • 17
4
votes
1 answer

Binding on-change in ClojureScript/Reagent

I am trying to understand how input fields work in Reagent. I first tried to bind on-change to a simple function that changes underlying atom: (defonce app-state (reagent/atom "Teodor")) (defn page [ratom] [:div [:p "Please enter your…
Teodor
  • 749
  • 7
  • 15
4
votes
3 answers

How to get index for an item in reagent

When I iterate over vector in Reagent, like this: (for [item ["rattata" "pidgey" "spearow"]] [:li item])]) I would like to get index of a specific item - like this: [:li item index] I'm not asking about general clojure 'for', because another…
Oskar Skuteli
  • 648
  • 6
  • 16
4
votes
2 answers

clojurescript/reagent for function doesn't work

Im recently using reagent and re-frame for my clojurescript project and i have a problem: So i have html custom tags And i want to swap them into my reagent-generated html using cljs for…
4
votes
1 answer

Using reagent/reactify-component to create React class for use in JSX

I'm trying to adapt a Reagent (using re-frame) program that contains a component I want to be able to use from a plain React program. Essentially I to be able to take a Reagent (re-frame) component like this: (defn my-component [] (fn [] (let…
dirtymikeandtheboys
  • 511
  • 2
  • 5
  • 17
4
votes
1 answer

Use HTML templates (as files) with Reagent

I have a project, which front-end stack has to be based on ClojureScript and React (through Reagent, not Om or other libs). Additionally, I have a large amount of HTML templates (as .html files) from designer, who knows nothing about Clojure, data…
RedZagogulin
  • 441
  • 3
  • 11
4
votes
3 answers

In ClojureScript, how do I properly use cljsjs/react-mdl?

I've really been struggling with cljsjs libraries, and I've probably spent 2 full days worth of my life playing with the interop of react-bootstrap, and various material libraries in clojurescript. Basically, I just want to be able to get UI…
Josh.F
  • 3,666
  • 2
  • 27
  • 37
4
votes
4 answers

How to access clojure reagent atom map variable?

I am new to Clojure and Reagent. Kindly tell how to print the variable first inside the atom variable contacts? (def app-state (r/atom {:contacts [{:first "Ben" :last "Lem" :middle "Ab"}]}))
CodeDoubts
  • 51
  • 4
4
votes
2 answers

Nested components in re-frame not updating

I'm building a single-page app using re-frame. Each "page" of the app calls a component base-page then supplies its page-specific children... (defn base-page [& children] (into [:div ; banner goes here ] children)) (register-sub…
John Krasnay
  • 313
  • 2
  • 9
4
votes
1 answer

Enumerate namespaces and dynamically load them in ClojureScript

This may actually be a bit of an XY-problem, so I'll try to explain what the goal is first. I'm building a ClojureScript application which is composed of a set of Reagent components. It provides a user interface where you can dynamically add or…
JoelKuiper
  • 4,362
  • 2
  • 22
  • 33
4
votes
1 answer

How to loop a JavaScript object and push each into an array, in Clojurescript

How can I convert this function (into Clojurescript) that takes a JavaScript object and pushes it's contents into an array. function toKeyValueList(obj) { var arr = []; for (var key in obj) { if (obj.hasOwnProperty(key)) { arr.push({ …
hzhu
  • 3,759
  • 5
  • 29
  • 39
4
votes
1 answer

Reagent does not register atom watch

I have simple newcomer's luminus with reagent application. I defined some component definition: (def md-vals (atom nil)) (defn markdown [url] (GET (str js/context url) {:handler (fn [response] (swap! md-vals assoc url…
Odomontois
  • 15,918
  • 2
  • 36
  • 71
4
votes
1 answer

React's Refs in Reagent (or Om)?

I sometimes find it useful to use React's Refs in order to change the state of the DOM as for example to focus an input field after rendering a component. Does Reagent or Om implement this or if not what is the idiomatic way to do this in those…
kliron
  • 4,383
  • 4
  • 31
  • 47