Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connect((state, props) => {
const children = Children.toArray(props.children).reduce(
(acc, child) => [...acc, ...(isValidElement(child) ? Children.toArray(child.props.children) : [])],
[]
);
return {
form: props.form || REDUX_FORM_NAME,
initialValues: getDefaultValues(state, { ...props, children }),
saving: props.saving || state.admin.saving,
tabsWithErrors: findTabsWithErrors(state, {
form: REDUX_FORM_NAME,
...props,
}),
};
}),
translate, // Must be before reduxForm so that it can be used in validation
connect((state, props) => {
const children = Children.toArray(props.children).reduce(
(acc, child) => [...acc, ...Children.toArray(child.props.children)],
[]
);
return {
form: props.form || REDUX_FORM_NAME,
initialValues: getDefaultValues(state, { ...props, children }),
saving: props.saving || state.admin.saving,
tabsWithErrors: findTabsWithErrors(state, {
form: REDUX_FORM_NAME,
...props,
}),
};
}),
translate, // Must be before reduxForm so that it can be used in validation
connect((state, props) => ({
form: props.form || REDUX_FORM_NAME,
initialValues: getDefaultValues(state, props),
saving: props.saving || state.admin.saving,
})),
translate, // Must be before reduxForm so that it can be used in validation
connect((state, props) => ({
form: props.form || REDUX_FORM_NAME,
initialValues: getDefaultValues(state, props),
saving: props.saving || state.admin.saving,
})),
translate, // Must be before reduxForm so that it can be used in validation