Use of `<Outlet />` vs `props.children` leads to duplicated code?
Take this component which renders
<Outlet />
to render child routes.
I want to reuse this component but not in a routing context, and I need to make use of props.children
, as I want to render child components and not child routes.
This leads me to having to duplicate the component code only because I need to use props.children
instead of <Outlet />
.
Anyone struggled with this?2 Replies