How to use the final-form.configOptions.forEach function in final-form

To help you get started, we’ve selected a few final-form 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 final-form / react-final-form-hooks / src / useForm.js View on Github external
useEffect(() => {
    if (config === prevConfig.current) {
      return
    }

    if (
      config.initialValues &&
      !initialValuesEqual(
        config.initialValues,
        prevConfig.current.initialValues
      )
    ) {
      form.initialize(config.initialValues)
    }

    configOptions.forEach(key => {
      if (key !== 'initialValues' && config[key] !== prevConfig.current[key]) {
        form.setConfig(key, config[key])
      }
    })

    prevConfig.current = config
  })

final-form

🏁 Framework agnostic, high performance, subscription-based form state management

MIT
Latest version published 7 months ago

Package Health Score

71 / 100
Full package analysis