chore: adjust file

This commit is contained in:
QiShaoXuan
2022-12-02 23:46:36 +08:00
parent 01bca1d082
commit 94ef380d20
11 changed files with 52 additions and 132 deletions
@@ -0,0 +1,16 @@
import { cloneElement, FC, PropsWithChildren, ReactNode } from 'react';
export const ProviderComposer: FC<
PropsWithChildren<{
contexts: any;
}>
> = ({ contexts, children }) =>
contexts.reduceRight(
(kids: ReactNode, parent: any) =>
cloneElement(parent, {
children: kids,
}),
children
);
export default ProviderComposer;