1.1.4 • Published 8 years ago

react-autofill v1.1.4

Weekly downloads
1,800
License
MIT
Repository
github
Last release
8 years ago

React Autofill

A component that polyfills a change event in Safari when input fields are autofilled.

Installation

npm install --save react-autofill

Usage

ES2015 (aka. ES6):

import React from 'react';
import ReactDOM from 'react-dom';
import autofill from 'react-autofill';

class Form extends React.Component {

    constructor() {
        super();
        this.state = {};
    }

    handleChange(e) {

        const { name, value } = e.currentTarget;
        const nextState = {};

        nextState[name] = value;

        this.setState(nextState);

    }

    render() {

        return (
            <form>
                <input
                    onChange={this.handleChange.bind(this)}
                    name="field"
                    value={this.state.field}/>
            </form>
        );

    }

}

ReactDOM.render(React.createElement(autofill(Form)), document.body);

ES7 (aka. ES2016):

@autofill
class Form extends React.Component {
    ...
}
1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.8

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.0

9 years ago