on d955c27 help sign in
bridge/src/form/WarningEngine.js
15 lines 349 B history raw
1import { useEffect } from 'react';
2import { useForm } from 'react-final-form';
3import { map } from 'lodash';
5export default function WarningEngine({ warnings }) {
6 const form = useForm();
8 useEffect(() => {
9 map(warnings, (warning, name) =>
10 form.mutators.setFieldData(name, { warning })
11 );
12 }, [form, warnings]);
14 return null;