How do I style nested element using reagent + reagent-materual-ui? I am trying to set width propery of the nested video element with
{:style
{:display :inline-block
:video {:height "200px"}}}
so it'd conform to in js/ts
sx = {'display': 'inline-block' , 'video': {'height' : '200px'}}
?
It won't work.Can you provide a full JSX element that uses those values?
I'm pretty sure you just need to write {:sx {:display :inline-block :video {:height "200px"}}} . Why are you putting the :style key in there?
hm. it's probably because I'm trying do to this on ["video-react" :refer [Player]] which doesn't support sx .
[:> Player (merge {:plays-inline true :src uri :sx {:video {:width "200px"}}} props)]I need to adapt it somehow.
is there any way to fix that?
I just peeked at the website for video-react and it looks like it uses an external stylesheet for this component
@bhlieberman93 yes, but I want that exact component to be restyled. not react-videos
It's been some time since I used MUI but I would check out styled components https://mui.com/system/styled/
reagent-mui supports them
hello, i asked before sometime, for Clojurescript and node modules, there is no auto-complete and editor help right? (for methods, fields etc) i am using cursive but i can change the editor if it works with some other editor, even if it doesn't work, is there a work-around on this?
You seem to be asking this question once a year. :) I believe nothing has changed since 2023.
Personally, I rely on docs, sources, and run-time object inspection.
It's not that dissimilar to how you already work with Clojure - of course, there's auto-complete for vars, but you don't know which function can be called on which value without also knowing what the function expects and that the value actually is.
yes! new year 2025 will bring the change! thank you
i am just spoiled from clojure that it works
but i think its useful anyways, not just spoiled, we will see next year!
> i am just spoiled from clojure that it works Does it? If we're talking about auto-completion during interop, then in Cursive it reliably works only for static fields on classes that you have already imported. Members can also be auto-completed, but from my perspective it's just guesswork that often doesn't auto-complete even something that I have already used.
And in a similar scenario, auto-completion for JS interop seems to be working.
in clojure when class was imported i could access easy methods/fields , i want something like this , but as far as i know we dont have it in ClojureScript.
import fsPr from "fs/promises";
It works for non-static members only if the corresponding class is imported in the same namespace. And even then - I'm 80% sure it didn't work for me in some cases, but I wouldn't be able to recall for which classes exactly. So if you have to pass some Java value to a different namespace, you're out of luck. Or if you want to call a member and are fine with using reflection - also out of luck.
But yeah, my example with js/Array is not that good since it's a built-in class and not something that you import.
In cursive you do get some completions on goog modules if I'm not mistaken.
in Clojure i had zero problems with java interop autocomplete, i could use all java things fine, i dont know what is goog modules, but in general i want to use it with node.js libraries and npm libraries
its ok, in 2025 maybe will be fixed!
goog modules are those that are distributed in the Google Closure Library, which is in maintenance mode but is still bundled with ClojureScript. This is a guess, but since those source files are on the class path, I think Cursive is able to pick them up and provide completions. I wonder if you could add other JS sources to the class path and achieve the same result think_beret
Doesn't seem like it. I doubt it has anything to do with classpath.
Maybe not the classpath alone, but Intellij has some built-in JS support I believe, and I wonder if that contributes as well. But idk, it's a shot in the dark.
I don't think it does, unfortunately: https://github.com/cursive-ide/cursive/issues/1252
I actually think 2025 will be the year for this! It does depend on the classpath, Cursive does actually parse all the goog stuff, and it has some support for built-in JS stuff, but that is fairly out of date. My plan is to base the support on TypeScript types, because parsing JS and figuring it out statically is nightmare fuel.
Hmm. I made the above comment after adding a JS file to the classpath (tried ESM and CJS), including it in a CLJS file (both as "..." and as "/..." since it was available at src/) - no auto-completion whatsoever.
Yes, the current support is mostly focused on goog modules, and handles those pretty well - back in the day, that was the most important things. But it's hard to support JS modules well statically. I think there is something there but I haven't kept it up to date and it never worked very well.
Is it not possible to use whatever machinery IDEA already has for JS? After all, it somewhat works.
when this added we party! 2025 or when you manage to do it, thank you anyways
> Is it not possible to use whatever machinery IDEA already has for JS? Unfortunately, this is harder than it sounds. All the JS support is predicated on the idea that you have a file of something that looks something like JS (e.g. TypeScript, CoffeeScript). For something like CLJS where it looks nothing like it, and the internal AST nodes don't extend the JS equivalents, it just doesn't work that well. They have recently updated their JS support with a new internal API though, so I will check with them if any of that has changed.
Similarly for LSP support - if your file doesn't look like JS, you're out of luck.