npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-fractal-field

v4.0.0

Published

predictable react router

Readme

npm npm Dependency Status devDependency Status peerDependency Status

react-fractal-field

$ npm install prop-types lodash react react-fractal-field --save

Usage

import { Field, FieldSet } from 'react-fractal-field';

const MyComponent = ({ onSubmit }) => (
  <FieldSet onSubmit={onSubmit} isolated>
    {({ triggerSubmit }) => (
      <div>
        <Field name="value">
          {({ control }) => (
            <div>
              <input {...control} type="text" />
            </div>
          )}
        </Field>
        <button onClick={triggerSubmit}>Submit</button>
      </div>
    )}
  </FieldSet>
)

API

common FieldSet/FieldList/Field props:

  • id: [ String, Number ] - ID used for remote controlling this field/form (null by default)
  • softTypes: [ Boolean ] - disable type checking. HIGHLY NOT RECOMMENDED!
  • isolated: [ Boolean ] - if true meta/value stopped from sharing between parent
  • name: [ String, Number ] - need for value binding
  • value: [String, Boolean, Number, Array, Object, Null]
  • initialValue: [String, Boolean, Number, Array, Object, Null] - values that will be provided for child fields (useful only for forms)
  • onChange: [ Function ] - handler that will be called on every field value changes
  • onValueChange: [ Function ] - handler that will be called on every field changes
  • validate: [ Function ] - validation function/array . if error it need to return the error-message string
  • onChangeValidity: [ Function ]
  • postponeInvalid: [ Boolean ]
  • form: [ Boolean ]
  • onSubmit: [ Function ] - handler that will be called on triggerSubmit only in valid form state
  • exceptionMessage: [ Any ] - error message in case validate/normalize/format throws the error
  • children: [ Function ] - obviously, content of field/form
  • autoClean: [ Boolean ]
  • debug: [ Boolean ]

Field props:

  • normalize: [ Function ] - filter value before call onChange/onSubmit/validate callback
  • format: [ Function ] - filter value before rendering (or set value to child field). from outer format to inner format

Common FieldSet/FieldList/Field children function params:

  • triggerChange: [ Function ] - call when you want to trigger change field by some case
  • triggerReset: [ Function ] - call when you want to trigger submit, obvious
  • value: [ Any ]
  • touched: [ Boolean ] - true when field or some child field was changed once
  • pristine: [ Boolean ] - true when field or some child field was not changed once
  • submitted: [ Boolean ] - when this form/field of parent was submitted once
  • valid: [ Boolean ] - true if children and this field has no errors
  • invalid: [ Boolean ] - true if children and this field/children has errors
  • hasException: [ Boolean ] - true if children and this field/children has exceptions
  • error: [ Any ] - first error are not false, that returned from validate function
  • invalidChildren: [ Array ] - ids of closest children with errors
  • active: [ Boolean ] - true if field/children is focusing right now
  • activated: [ Boolean ] - true if field/children was focused once
  • form: [ Object ] - Props of closest isolated form (or field itself)

Common FieldSet/FieldList/Field children function params when props.form is true:

  • triggerSubmit: [ Function ] - call when you want to trigger submit, obvious
  • submitSuccess: [ Boolean ] - state of submitting
  • submitFailed: [ Boolean ] - state of submitting
  • submitting: [ Boolean ] - state of submit processing. in pending (if onSubmit returns the Promise object)
  • submitted: [ Boolean ] - true if form was submitted once
  • submittedTimes: [ Number ] - count of triggerSubmit calling
  • submitErrors - Any - payload of submitting

Field children function params

  • control: { value, onChange, onBlur, onFocus } - shortcut for putting it into control component (only for components without children fractal-fields)

FieldList children function params:

  • removeItems: [ Function ]
  • appendItems: [ Function ]
  • prependItems: [ Function ]
  • items: [ Array ]

Remote api

  • triggerSubmit(id)
  • triggerChange(id)
  • onError(callback)