New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bear-out

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bear-out

Using React forms libraries never quite solved the problems we were faced with. Many require context or a `<form>` element and are confusing to perform validation. It's just too much overhead if you are creating a simple form with 1-2 fields.

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

🐻 Bear Out

Problem

Using React forms libraries never quite solved the problems we were faced with. Many require context or a <form> element and are confusing to perform validation. It's just too much overhead if you are creating a simple form with 1-2 fields.

Solution

Bear Out is a high performance, no dependency and no frills library with the intent of giving you primitives to do simple form/field management and validation without a lot of overheard.

What's with the name?

According to Merriam-Webster, the definition of bear out is:

to give evidence or testimony to the truth or factualness of

Bear Out gives you the tools to validate (give evidence or testimony) your application's inputs (truth or factualness).

It's a stretch...

Quick Start

Installation

npm add bear-out

or

yarn install bear-out

Build a simple counter

Here we're building a counter that allows you to change the value via numbers or by modifying the input itself.

const Counter = () => {
  const { value, setValue, inputProps } = useBearOutField(0);

  const increment = () => setValue(v => v + 1);
  const decrement = () => setValue(v => v - 1);
  const addValue = (num: number) => setValue(v => v + num);

  return (
    <div>
      <h1>useBearOutField</h1>
      <div title="counter">{value}</div>
      <div>
        <input type="number" {...inputProps} />
      </div>
      <button onClick={increment}>Increment</button>
      <button onClick={decrement}>Decrement</button>
      <button onClick={() => addValue(2)}>Add Two</button>
    </div>
  );
};

FAQs

Package last updated on 09 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc