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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-hoc-form-validatable

v0.8.7

Published

React higher order components for validate form. Can use with Promise

Downloads

27

Readme

Build Status Coverage Status dependencies Status

Most important news

v0.7.0

Breaking changes:

  • Props dirty now only equal to true when the new value is !== old value (shallow compare). Before v0.7.0 prop dirty equal to true when on change new value, form submit.

v0.6.0

  • Fix change default value no re validate input.
  • Add onUnRegistered, onRegistered callback for HOCInput.

v0.5.6

  • Filter unwanted props to HOCInput children.
  • Improve typescript d.ts.

v0.5.0

  • Remove babel-cli as dep
  • Use new context react api. So from 0.5.0 will require react > 16.3.0

v0.4.0

  • validateLang now is optional props in HOCForm
  • cancelablePromise fix unhandled reject promise. cancelablePromise now only use internally. Async rules no need to use cancelablePromise.
  • Now support multiple async rules.
  • Added errorAsyncRuleCallback to handle errors in async rules.
  • Partial support typescript (need improve more)

Intro

react-hoc-form-validatable is a library has a higher order form and input components that help validate form easily, especially with asynchronous validate come from the server with the help of Promise ES6.

The library aim to create a validatable component that easy to work with any other input components. So you can make your own form components with your own styling.

Install

npm -i react-hoc-form-validatable

or

yarn add react-hoc-form-validatable

Demo

Demo online

Docs

You should check the docs and the demo source
to see how to use it.

Notes

The library requires Promise polyfill by your app if you want to use asynchronous validation (It mean the Promise polyfill is not shipped with the library). Your Promise polyfill has to support Promise.cancel(). For that, you can use BlueBird or use the wrapper that provided in this library.

The library uses Higher Order Component technique and React context to make it possible.

Before use this library you should have knowledge about Higher Order Component.

About React context you should understand it if you want to create your own HOC Input Component.

Your Input Component should be controlled component. Meaning the form validate will pass the value to the input. See the definition here