Sha256: 1c5586edd4a6d381efe934d22dc9449b9beda85851f03caafbeb37ae5d1c8517
Contents?: true
Size: 1.42 KB
Versions: 3
Compression:
Stored size: 1.42 KB
Contents
import React from "react" import { Caption, TextInput, Title, } from "../../" class TextInputDefault extends React.Component { state = { firstName: "" } render() { const handleOnChange = ({target}) => this.setState({firstName: target.value}) const { firstName, } = this.state return ( <div> <TextInput label="First Name" placeholder="Enter first name" value="Timothy Wenhold" /> <TextInput label="Last Name" placeholder="Enter last name" /> <TextInput label="Phone Number" placeholder="Enter phone number" type="phone" /> <TextInput label="Email Address" placeholder="Enter email address" type="email" /> <TextInput label="Zip Code" placeholder="Enter zip code" type="number" /> <br/> <br/> <Title>{`Event Handler Props`}</Title> <br/> <Caption>{`onChange`}</Caption> <br/> <TextInput label="First Name" onChange={handleOnChange} placeholder="Enter first name" value={firstName} /> <If condition={firstName !== ""}> {`First name is: ${firstName}`} </If> </div> ) } } export default TextInputDefault
Version data entries
3 entries across 3 versions & 1 rubygems