How to use the react-tinacms.usePlugins function in react-tinacms

To help you get started, we’ve selected a few react-tinacms 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 / gatsby-tinacms-json / src / use-json-form.ts View on Github external
export function useGlobalJsonForm(
  jsonNode: JsonNode | null,
  formOptions: Partial> = {}
) {
  const [values, form] = useJsonForm(jsonNode, formOptions)
  usePlugins(
    React.useMemo(() => {
      if (form) {
        return new GlobalFormPlugin(form, null)
      }
    }, [form])
  )
  return [values, form]
}
github tinacms / tinacms / packages / gatsby-tinacms-json / src / use-json-form.ts View on Github external
export function useLocalJsonForm(
  jsonNode: JsonNode | null,
  formOptions: Partial> = {}
) {
  const [values, form] = useJsonForm(jsonNode, formOptions)
  usePlugins(form as any)
  return [values, form]
}

react-tinacms

> This package is no longer necessary or supported. You may instaed use the [`tinacms`](https://www.npmjs.com/tinacms) package directly.

Apache-2.0
Latest version published 5 years ago

Package Health Score

62 / 100
Full package analysis