@contentful/field-editor-shared

v0.10.4
This package contains shared code (components, utilities, test utilities) that is used by all other field editor packages.

@contentful/field-editor-shared

This package contains shared code (components, utilities, test utilities) that is used by all other field editor packages.

The most useful component for developing any kind of apps is FieldConnector that helps you to subscribe to field changes in a convenient way.

Checkout a simple implementation of an app for Boolean field:


import { FieldConnector } from '@contentful/field-editor-shared';

<FieldConnector<boolean> field={sdk.field}>
    {({ disabled, value, setValue }) => {
      return (
        <div>
          <div>{value ? 'I am true' : 'I am false'}</div>
          <button onClick={() => {
            setValue(!value)
          }}>
            toggle
          </button>
        </div>
      )
    }}
</FieldConnector>
npm i @contentful/[email protected]

Metadata

  • MIT
  • Whatever
  • Contentful GmbH
  • released 5/26/2020

Downloads

Maintainers

abkim127, anho, argvk_cf, arisplakias, burakukula, cakejelly, cezarluiz0, cribbles, cstillitano, danwe, davidfateh, diacono, didi96, djagya, dlitvakb, dominic.bonnice, dominik.markusic, dvasylenko, eamodeorubio, elblivion, erdener, fadynaffa3, farruco.sanjurjo, felipecoe, felixboenke, freakyfelt, gb-ctf-ext, gosiaszporer, gregferg, guilebarbosa, guisantos, hwartig, it-internal, jakub-contentful, janikomu, janogonzalez, joaoramos, johannes_bugiel, johanneswuerbach, joshuasmock, jroehl, juliabiro, jwhiles, kbarnett, kdamball, kgarbaya, lehnerm-cf, leonardofreitass, m10l, makinwa37, malin_sofrone, marcolink, marina-cf, martin3walker, matthew-hickey, medturki, miretxu, mshaaban0, mspagnolo, phbschmidt, poberherr, roboben, ronaldronson, ruderngespra, sbezludny, sey1000, silhoue, sonac, stupchiy, suevalov, tauraz, taye, thebesson, thomas.spiesser, timbeyer, twooster-cf, vbeleuta, whydah-gally, yann-cf, yiotis, z0al, zcei,