fix: merge conflict

This commit is contained in:
dream2023 2024-03-06 14:42:24 +08:00
parent b46214acbd
commit 55d055f801

View File

@ -0,0 +1,18 @@
import React, { FC, createContext, useMemo } from 'react';
import { ISchemaComponentContext } from './types';
export const SchemaComponentContext = createContext<ISchemaComponentContext>({});
SchemaComponentContext.displayName = 'SchemaComponentContext';
export const SchemaComponentChangelessContext = createContext<ISchemaComponentContext>({});
SchemaComponentChangelessContext.displayName = 'SchemaComponentChangelessContext';
export const SchemaComponentContextProvider: FC<{ value: ISchemaComponentContext }> = ({ children, value }) => {
const changelessContextValue = useMemo(() => {
return value;
}, Object.values(value));
return <SchemaComponentContext.Provider value={value}>
<SchemaComponentChangelessContext.Provider value={changelessContextValue}>
{children}
</SchemaComponentChangelessContext.Provider>
</SchemaComponentContext.Provider>;
};