How to use the ra-core.getDefaultValues function in ra-core

To help you get started, we’ve selected a few ra-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bootstrap-styled / ra-ui / src / components / form / TabbedForm.js View on Github external
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
github marmelab / react-admin / packages / ra-ui-materialui / src / form / TabbedForm.js View on Github external
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
github marmelab / react-admin / packages / ra-ui-materialui / src / form / SimpleForm.js View on Github external
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
github bootstrap-styled / ra-ui / src / components / form / SimpleForm.js View on Github external
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