Fork me on GitHub
#reagent
<
2023-05-10
>
Ryan19:05:51

I have a JS react component I instanciate like so: [:> TabView]. If I make a component that outputs its relevant [:> TabPanel] .. I get no output. If I put the [:> TabPanel] directly as a child of the TabView, works great. Any clues?

p-himik19:05:13

Maybe TabView really wants for instances of TabPanel to be its direct children. Or maybe there's a mistake in how you're creating the wrapper component.

Ryan19:05:39

I think its the former, I tried a really static payload for the TabPanel and it behaved similarly identically. Is there any way to write a fn to output the direct TabPanel? I know I’ve had to use reagent.core/as-element to pass components in fn parameters with this library, but it didn’t seem to do the trick here.

p-himik19:05:52

Sure - just write a regular function and call it directly with (...) instead of using it in Regent Hiccup as [...].

Ryan19:05:39

Aha. Of course. Thanks so much @U2FRKM4TW 🙂

👍 1