demo/index.js
// All form inputs are using this function
All form inputs are using this function
All form inputs are using this function
handleChange(event) {
    const stateKey = event.target.name.replace('form__', '');
    let value =
      event.target.type === 'checkbox'
        ? event.target.checked
        : event.target.value;
    if (stateKey == 'headingStartLevel') {
      value = parseInt(value);
    }
    this.setState({ ...this.state, changes: true, [stateKey]: value });
  }
handleChange ( event ) { const stateKey = event . target . name . replace ( 'form__' , '' ) ; let value = event . target . type === 'checkbox' ? event . target . checked : event . target . value ; if ( stateKey == 'headingStartLevel' ) { value = parseInt ( value ) ; } this . setState ( { ... this . state , changes : true , [ stateKey ] : value } ) ; }
All form inputs are using this function
All form inputs are using this function