Skip to content

Instantly share code, notes, and snippets.

@kaievns
Created December 7, 2017 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaievns/3a74c62b23ec1a9e42cab90a22435dc6 to your computer and use it in GitHub Desktop.
Save kaievns/3a74c62b23ec1a9e42cab90a22435dc6 to your computer and use it in GitHub Desktop.
import { field, TextInput } from 'a-plus-forms';
@field()
class PhoneInput extends React.Component {
onChange = (text) => {
const phoneNumber = format(text); // to phone number
this.props.onChange(phoneNumber);
}
render() {
return <TextInput {...this.props} onChange={this.onChange} />;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment