Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { getFieldProps, getFieldDecorator } = props.form;
if (initialValues.env) {
try {
const env = JSON.parse(initialValues.env);
initialValues.env = _.map(env, (value, name) => {
return {
name, value,
};
});
} catch (e) {
console.log(e);
}
}
const { list, remove, getKey, push, resetList } = useDynamicList(initialValues.env);
useEffect(() => {
resetList(initialValues.env);
}, [JSON.stringify(initialValues.env)]);
getFieldDecorator('collect_type', {
initialValue: initialValues.collect_type,
});
const [submitLoading, setSubmitLoading] = useState(false);
const handleSubmit = (e: any) => {
e.preventDefault();
props.form.validateFields((errors: any, values: any) => {
if (errors) {