Skip to content

Commit

Permalink
fix(core/presentation): Fix FormikExpressionInput initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Oct 14, 2019
1 parent be258cd commit 088f50b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ export interface IFormikExpressionFieldState {
spelError: ISpelError;
}

const initialSpelData: IExpressionChange = {
value: null,
spelError: null,
spelPreview: null,
};

export function FormikExpressionField(props: IFormikExpressionFieldProps) {
const { context, name, label, help, actions, validationMessage: message } = props;

const [spelData, setSpelData] = React.useState<IExpressionChange>();
const [spelData, setSpelData] = React.useState<IExpressionChange>(initialSpelData);

const markdown = firstDefined(props.markdown, false);
const validationNode = useValidationData(message, true);
Expand Down

0 comments on commit 088f50b

Please sign in to comment.