reagent

Alejandro 2023-03-23T07:28:01.493279Z

Do reagent components have to enclose everything in divs? Is there a way to avoid having a div inside of a div when the app gets rendered? UPDATE:

<div id="app">
    <div>
        <!-- the contents of a single component -->
        <!-- a lot of tags here -->
    </div>
</div
I mean, to render directly to the app div when I have one component?
<div id="app">
    <!-- the contents of a single component -->
    <!-- a lot of tags here -->
</div

hkjels 2023-03-23T07:40:28.724389Z

[:> [:a] [:a]]

hkjels 2023-03-23T07:40:41.470829Z

You mean something like that?

Alejandro 2023-03-23T07:47:04.799969Z

I updated the question, added an example for clarity.

hifumi123 2023-03-23T08:14:05.658599Z

I would also guess rendering a fragment into div#app

hifumi123 2023-03-23T08:14:33.683679Z

i.e. your root component is just something like

[:<>
 [a-component]
 [other-stuff]]

Alejandro 2023-03-23T08:22:28.301229Z

@hkjels, ah, I didn't recognize it as reagent's syntax. What does :> mean? Never used it, nor :<>

Alejandro 2023-03-23T08:22:44.793619Z

@hifumi123, that's what I'm looking for, thanks.

hifumi123 2023-03-23T08:23:40.335139Z

For reference, :<> is a syntax shortcut for React fragments. :> is a shortcut for r/adapt-react-class. You typically use :> when you are using a JS React component

Alejandro 2023-03-23T08:24:29.845289Z

@hifumi123, great, thanks.

hifumi123 2023-03-23T08:25:32.794889Z

Unfortunately the reagent docs don’t concentrate this info in a single page, but here are sources for both of these things. https://github.com/reagent-project/reagent/blob/master/doc/ReactFeatures.md https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md

❤️ 1