The reatomComponent
has next props type:
props: T & { ctx: CtxRender; }
I need to create a component with generic props as shown below:
interface GenericComponentProps<T> {
items: T
}
const GenericComponent = reatomComponent(<T,>({ ctx, items }: GenericeComponentProps<T>) => {}, 'GenericeComponent');
But obviously ctx
is not there.
I tried to import CtxRender
and put it in the props but @reatom/npm-react
doesn't export it.
So it would be great if you add something like this (inspired by React.PropsWithChildren
)
type PropsWithCtx<T = unknown> = T & { ctx: CtxRender };
or at least you should export CtxRender
in @reatom/npm-react
Package @reatom/npm-react
3.8.6
Microsoft Edge
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too