Hi,
am I mistaken or do Cells cannot take children?
I am wondering, why this is the case? Cells could be much more powerful with children. They would work similar to react suspense. Every component within a cell would know, it has its data.
It would allow me to use a cell i.e. within a layout and give all its subroutes the same data:
<Set wrap={TenantLayout}>
<Route path={"/overview/{entry}"}.... />
<Route path={"/settings"}.... />
<Route path={"/project/{project}"}.... />
</Set>
This is how I would need to do it right now, losing the option to let children routes to know they have tenant data:
const TenantLayout = ({children}:PropsWithChildren) => {
return <>
<TenantCell />
{children}
</>
}
This is how I would like to do it:
const TenantLayout = ({children}:PropsWithChildren) => {
return <TenantCell>
{children}
</TenantCell>
}
Because only through the latter approach, all routes within the layout would have access to the TenantCell data i.e. via useQuery hook. The latter could be easily wrapped via generators: Hooks as addition to Cells
I understand that cells are set up to be self contained. But this does not seem to be reaonsable in practical use right now.
Couldn´t we just pass the children prop of the above linked line 276 into the Success component?
I tried to bypass it with a custom renderChildren prop via beforeQuery, but this is definitely no solution, since the prop is being serialized for the query…
Related: