Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, {
ComponentType,
Dispatch,
Fragment,
ReducerAction,
useMemo,
useState,
useEffect,
Expand All @@ -17,6 +16,7 @@ import {
import {
composePaths,
ControlElement,
CoreActions,
findUISchema,
JsonFormsRendererRegistryEntry,
JsonSchema,
Expand Down Expand Up @@ -258,7 +258,7 @@ export const ExpandPanelRenderer = React.memo(ExpandPanelRendererComponent);
* @returns {DispatchPropsOfArrayControl} dispatch props of an expand panel control
*/
export const ctxDispatchToExpandPanelProps: (
dispatch: Dispatch<ReducerAction<any>>
dispatch: Dispatch<CoreActions>
) => DispatchPropsOfExpandPanel = (dispatch) => ({
removeItems: useCallback(
(path: string, toDelete: number[]) =>
Expand Down
11 changes: 5 additions & 6 deletions packages/react/src/JsonFormsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ import debounce from 'lodash/debounce';
import React, {
ComponentType,
Dispatch,
ReducerAction,
useCallback,
useContext,
useEffect,
Expand All @@ -107,7 +106,7 @@ const initialCoreState: JsonFormsCore = {
};

export interface JsonFormsStateContext extends JsonFormsSubStates {
dispatch?: Dispatch<ReducerAction<typeof coreReducer>>;
dispatch?: Dispatch<CoreActions>;
}

export const JsonFormsContext = React.createContext<JsonFormsStateContext>({
Expand Down Expand Up @@ -276,7 +275,7 @@ export const useJsonForms = (): JsonFormsStateContext =>

export interface JsonFormsReduxContextProps extends JsonFormsSubStates {
children: any;
dispatch: Dispatch<ReducerAction<any>>;
dispatch: Dispatch<CoreActions>;
}

export const ctxToArrayLayoutProps = (
Expand Down Expand Up @@ -373,7 +372,7 @@ export const ctxToAllOfProps = (
};

export const ctxDispatchToControlProps = (
dispatch: Dispatch<ReducerAction<any>>
dispatch: Dispatch<CoreActions>
): DispatchPropsOfControl =>
useMemo(() => mapDispatchToControlProps(dispatch as any), [dispatch]);

Expand Down Expand Up @@ -409,7 +408,7 @@ export const ctxToJsonFormsRendererProps = (
) => mapStateToJsonFormsRendererProps({ jsonforms: { ...ctx } }, ownProps);

export const ctxDispatchToArrayControlProps = (
dispatch: Dispatch<ReducerAction<any>>
dispatch: Dispatch<CoreActions>
) => ({
...ctxDispatchToControlProps(dispatch),
...useMemo(() => mapDispatchToArrayControlProps(dispatch as any), [dispatch]),
Expand Down Expand Up @@ -473,7 +472,7 @@ export const ctxToDispatchCellProps = (
};

export const ctxDispatchToMultiEnumProps = (
dispatch: Dispatch<ReducerAction<any>>
dispatch: Dispatch<CoreActions>
) => ({
...ctxDispatchToControlProps(dispatch),
...useMemo(() => mapDispatchToMultiEnumProps(dispatch as any), [dispatch]),
Expand Down
Loading