Skip to content

Instantly share code, notes, and snippets.

@beausmith
Created May 2, 2018 23:17

Revisions

  1. beausmith created this gist May 2, 2018.
    5 changes: 5 additions & 0 deletions inputHandler.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    updateInputValue = ({ currentTarget: { name, value, checked, type } }) => {
    this.setState({
    [name]: type === 'checkbox' ? checked : value || this.initialState[name]
    })
    }