This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-25
Channels
- # announcements (1)
- # babashka (3)
- # beginners (48)
- # calva (1)
- # clj-kondo (1)
- # cljs-dev (6)
- # clojure (29)
- # clojure-europe (15)
- # clojure-spec (1)
- # clojure-uk (8)
- # clojurescript (17)
- # conjure (23)
- # css (7)
- # cursive (16)
- # datascript (1)
- # emacs (4)
- # fulcro (32)
- # hoplon (3)
- # keechma (16)
- # leiningen (1)
- # luminus (1)
- # meander (11)
- # off-topic (18)
- # pathom (15)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # reveal (5)
- # spacemacs (5)
- # xtdb (18)
Hello, Is there a way to dispatch reframe events from Javascript functions in the webpage? I would like to migrate to reframe an app I made that uses google maps. When you click on a markup in gmaps a javascript event function handler is called. I would like to know if there is a way to dispatch a reframe event from theses javascript functions. Thank you
That wrapper can do that. And whatever else might be needed to bridge JS and re-frame.
A non related question. Has anyone worked with reframe and https://react-bootstrap.github.io/? I found some examples of integrating https://github.com/burhanloey/reagent-react-bootstrap/tree/master/src/reagent_react_bootstrap. But I was wondering, given that reframe comes with its own react (from my understanding), if it was possible to tell reframe to use react-bootsrap instead of react or if that would lead to some unwanted conflicts? Thank you
re-frame doesn't come with its own React. re-frame uses Reagent, which requires React.
And react-bootstrap
is just a library built on top of React. If you decide to use it, it will just use React that's already used in your project.
Ah ok. Thanks for clarifying @U2FRKM4TW
Its pretty easy to use react-bootstrap especialy if you use shadow-cljs to load the react and react-bootstrap npm libraries via the package.json. Something along the lines of:
(ns myapp.react-bootstrap
(:require
[reagent.core :as r]
["react-bootstrap" :as rs]))
(defn adapt [component]
(try
(r/adapt-react-class component)
(catch js/Object e
(prn e.message))))
(def accordion (u/adapt rs/Accordion))
(def accordion-toggle (u/adapt rs/Accordion.Toggle))
(def accordion-collapse (u/adapt rs/Accordion.Collapse))
(def alert (u/adapt rs/Alert))
... Continue with all the react-bootstrap components you want to use
Then use them in your app
(ns myapp.view
(:require
[reagent.core :as r]
[myapp.react-bootstrap :as rb]))
(defn some-alert []
[rb/alert {:variant "warning"} "It's a trap!"])
You can also use the react-bootstrap compoents inline with the :>
similar to how they used react-markdown in https://github.com/reagent-project/reagent/blob/master/examples/react-mde/src/example/core.cljs