1.0.5 • Published 5 years ago

@jsxtools/ref-on v1.0.5

Weekly downloads
1
License
CC0-1.0
Repository
github
Last release
5 years ago

ref-on

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>
  );
}
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago