mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor!: next generation AFFiNE code structure (#1176)
This commit is contained in:
14
apps/web/src/components/provider-composer.tsx
Normal file
14
apps/web/src/components/provider-composer.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
);
|
||||
Reference in New Issue
Block a user