-
-
Save alanbsmith/2617f9c12f52e9a804db3ae73c52225c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/components/App/index.js | |
import React, { Component } from "react"; | |
import classNames from 'classnames'; | |
import { validatePhone } from 'input-validator-lib'; | |
import "src/assets/stylesheets/base.scss"; | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
inputError: false, | |
phoneNumber: "" | |
}; | |
} | |
handleChange(phoneNumber) { | |
const inputError = !validatePhone(phoneNumber); | |
this.setState({ | |
inputError, | |
phoneNumber, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment