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[:> [:a] [:a]]
You mean something like that?
I updated the question, added an example for clarity.
I would also guess rendering a fragment into div#app
i.e. your root component is just something like
[:<>
[a-component]
[other-stuff]]
@hkjels, ah, I didn't recognize it as reagent's syntax. What does :> mean? Never used it, nor :<>
@hifumi123, that's what I'm looking for, thanks.
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
@hifumi123, great, thanks.
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