Rendering live_components under stateless function components

Hi there,

I have a stateless &infinite_scroll/1 function component that works perfectly by itself.

But when this component renders a block with a live_component inside (in my case, a stateful Table live_component), I get the following error:

Cannot convert component Components.Table with id "user-table" to HTML
A component must always be returned directly as part of a LiveView template.

I can fix the error by converting &infinite_scroll/1 to an InfiniteScroll live_component. But it seems awkward, because it is a stateless component by nature.

Am I missing something?

1 Like

It seems that if the main template is written using HEEX the issue disappears.
I’m not really sure why, but it solves my problem :man_shrugging:

1 Like