Is it possible to add :hover
to an element using hiccup? I’ve tried variations of the attached snippet but the only thing that works is adding the css to a class externally (not inline in hiccup).
Pseudo classes cannot be used in inline styles. You will have to use a <style>
tag and CSS selectors.
Ahhh, thanks for the clarification @p-himik . Much appreciated!
Thanks for the links!
Can reagent/with-let
be safely used within the :reagent-render
function of a form-3 component?
What about the inner function of a form-2 component?
It looks like with-let basically emits the body of a form-2 component
So I would not expect you can nest it inside another form-2
Hmm maybe I’m wrong. The with-let code is a bit hard to follow
More on that - are there any examples on how to use with-let - I only found a reference here and there, but no clear explanation (granted, it was few months ago)
@lilactown Not sure I follow. with-let
doesn't emit any fn
except for the destroy
clause.
Here's one example in the blog post where it was introduced: https://reagent-project.github.io/news/news060-alpha.html
Another couple here: https://github.com/reagent-project/reagent/blob/2027a2d8881bae0567ecf9d4c90550b064a2ad0c/doc/CreatingReagentComponents.md#appendix-b---with-let-macro And there are also tests for it in the Reagent repo.
Yeah I was wrong
Thanks! That's super helpful - I remember seeing this post, but (silly me) I disregarded it since it was from 2015 ;-)
Its implementation is indeed hard to follow, especially given that I'm not that familiar with the rest of the Reagent internals on which with-let
relies.
But my preliminary assessment along with my intuition tell me that using with-let
in form-{2,3} components is prooobably fine. :)
It might be cool to add some tests for that
Another potential use-case - with-let
within with-let
.
I think that is in reagent tests when I peeked