@jsxtools/ref-on
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

ref-on

npm version build status issue tracker pull requests

ref-on lets you handle DOM events like React synthetic events.

It is 854 bytes (449 gzipped).

Installation

npm install @jsxtools/ref-on

Usage

import on from '@jsxtools/ref-on';

function FormField() {
  return (
    <p ref={on({
      focusin (event) {
        console.log(event.target); // <input>
      },
      input (event) {
        console.log(event.target.value); // <input>’s value
      }
    })}>
        <label htmlFor="gn">Given Name</label>
        <input id="gn" />
    </p>
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jsxtools/ref-on

Weekly Downloads

1

Version

1.0.5

License

CC0-1.0

Unpacked Size

11.1 kB

Total Files

7

Last publish

Collaborators

  • jonathantneal