How to use the @tinacms/react-core.usePlugins function in @tinacms/react-core

To help you get started, we’ve selected a few @tinacms/react-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 tinacms / tinacms / packages / tinacms / src / react-tinacms / use-form.ts View on Github external
export function useGlobalForm(
  options: FormOptions,
  watch: Partial = {}
): [FormShape, Form | undefined] {
  const [values, form] = useForm(options, watch)

  const GlobalForm = useMemo(() => {
    if (!form) return

    return new GlobalFormPlugin(form)
  }, [form])

  usePlugins(GlobalForm)

  return [values, form]
}

@tinacms/react-core

_Note: This is an internal module for interacting with the `@tinacms/core`. It is meant for use within `tinacms`. You probably want to be using `react-tinacms`._

Apache-2.0
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis

Similar packages