Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
terrierscript authored Aug 19, 2018
1 parent fe08c03 commit 529eef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ import MaterialInput from '@material-ui/core/Input';

// Will work fine
const Input = (props) => (
<InputMask mask="99/99/9999" value={this.state.value} onChange={props.onChange}>
<InputMask mask="99/99/9999" value={props.value} onChange={props.onChange}>
{(inputProps) => <MaterialInput {...inputProps} type="tel" disableUnderline />}
</InputMask>
);

// Will throw an error because InputMask's and children's onChange aren't the same
const InvalidInput = (props) => (
<InputMask mask="99/99/9999" value={this.state.value}>
<InputMask mask="99/99/9999" value={props.value}>
{(inputProps) => <MaterialInput {...inputProps} type="tel" disableUnderline onChange={props.onChange} />}
</InputMask>
);
Expand Down

0 comments on commit 529eef6

Please sign in to comment.