reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
joshkh 2020-09-19T10:29:59.028100Z

i'm trying to implement this very basic example of using https://baseweb.design/guides/theming#default-themes

import React from 'react';
import {LightTheme} from 'baseui';
import { Button } from "baseui/button";

 export default function App() {
  return (
    <ThemeProvider theme={LightTheme}>
      I can use themed Base Web components here!
      <Button>Hello</Button>
    </ThemeProvider>
  );
}
with reagent:
(ns app.view
  (:require ["baseui" :refer [LightTheme ThemeProvider]]
            ["baseui/button" :refer [Button]]))

(defn app []
  [:> ThemeProvider {:theme LightTheme}
   "I can use themed Base Web components here!"
   [:> Button "Hello"]])
everything compiles fine, and i see the Button component as a button, but the theme LightTheme should be applied to all descendant components of ThemeProvider which is not happening. can anyone spot something wrong with my syntax before i continue digging into BaseUI itself?

lispers-anonymous 2020-09-19T20:03:16.030600Z

This may be a simple question that has been addressed before, but I'm having trouble finding an answer online. Is it safe to deref a reagent atom or reaction outside of a component? I know there are concerns with using re-frame subscriptions outside components and that causing a memory leak, but I think that is specific to the re-frame subscription caching. Are there similar concerns for plain reagent atoms?

p-himik 2020-09-19T20:08:53.031300Z

AFAIK it's fine. There are specific checks for that.

1🙏
lispers-anonymous 2020-09-19T20:17:23.031600Z

Thank you!