fix: custom fields values resetting in ui (#626)

This commit is contained in:
Dan Ribbens
2022-06-08 11:37:31 -04:00
committed by GitHub
parent 7fe2fece6c
commit f2bf2399fa
2 changed files with 9 additions and 4 deletions

View File

@@ -1,14 +1,12 @@
import React from 'react';
import { Props } from './types';
import withCondition from '../../forms/withCondition';
const RenderCustomComponent: React.FC<Props> = (props) => {
const { CustomComponent, DefaultComponent, componentProps } = props;
if (CustomComponent) {
const ConditionalCustomComponent = withCondition(CustomComponent);
return (
<ConditionalCustomComponent {...componentProps} />
<CustomComponent {...componentProps} />
);
}