mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 20:16:58 +00:00
fix(CollectionManagerSchemaComponentProvider): fix incorrect scope value
This commit is contained in:
parent
da8b43d932
commit
e4d1242e84
@ -7,14 +7,13 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { SchemaComponentOptions } from '..';
|
import { SchemaComponentOptions } from '..';
|
||||||
import { CollectionProvider_deprecated } from './CollectionProvider_deprecated';
|
import { CollectionProvider_deprecated } from './CollectionProvider_deprecated';
|
||||||
import { ResourceActionProvider, useDataSourceFromRAC } from './ResourceActionProvider';
|
import { ResourceActionProvider, useDataSourceFromRAC } from './ResourceActionProvider';
|
||||||
import * as hooks from './action-hooks';
|
import * as hooks from './action-hooks';
|
||||||
import { DataSourceProvider_deprecated, SubFieldDataSourceProvider_deprecated, ds } from './sub-table';
|
import { DataSourceProvider_deprecated, SubFieldDataSourceProvider_deprecated, ds } from './sub-table';
|
||||||
|
|
||||||
const scope = { cm: { ...hooks, useDataSourceFromRAC }, ds };
|
|
||||||
const components = {
|
const components = {
|
||||||
SubFieldDataSourceProvider_deprecated,
|
SubFieldDataSourceProvider_deprecated,
|
||||||
DataSourceProvider_deprecated,
|
DataSourceProvider_deprecated,
|
||||||
@ -23,6 +22,7 @@ const components = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CollectionManagerSchemaComponentProvider: React.FC = (props) => {
|
export const CollectionManagerSchemaComponentProvider: React.FC = (props) => {
|
||||||
|
const scope = useMemo(() => ({ cm: { ...hooks, useDataSourceFromRAC }, ds }), []);
|
||||||
return (
|
return (
|
||||||
<SchemaComponentOptions scope={scope} components={components}>
|
<SchemaComponentOptions scope={scope} components={components}>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
Loading…
Reference in New Issue
Block a user