1.1.1 • Published 5 years ago

react-input-interceptor v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-input-interceptor

React Input component data parse and format.

How to use?

Install

> npm install react-input-interceptor

Example(based on antd)

import React, { Component } from 'react';
import { Form, Input } from 'antd';
import InputInterceptor from 'react-input-interceptor'

@Form.create()
class Example extends Component {
  // view => model
  handleParse = (value) => {
    // do something
  }

  // model => view
  handleFormat = (value) => {
    // do something
  }

  render() {
    const { form } = this.props;
    const { getFieldDecorator } = form;

    return (
      <div>
        {
          getFieldDecorator('field')(
            <InputInterceptor parse={this.handleParse} format={this.handleFormat}>
              <Input />
            </InputInterceptor>
          )
        }
      </div>
    )
  }
}
1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

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

5 years ago

1.0.0

5 years ago