почему реагирует редуксный ввод не работает? - PullRequest
0 голосов
/ 05 июля 2019

Помогите мне выяснить, почему вводимый текст не требует ввода, когда я набираю текст, ниже приведен код.

Заранее благодарим и оценим ваш ответ

import './login.css';
import {connect} from 'react-redux'
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';

import React,{Component} from 'react';
// import Alert from 'react-s-alert';
import {Field, reduxForm, reset, change} from 'redux-form';





export const renderTextField = ({
  input,
  label,
  id,
  multiLine,
  rowsMax,
  fullWidth,
  disabled,
  hintText,
  defaultValue,
  onChange,
  maxLength,
  loader,
  meta: { touched, error },
  customError,
  autoFocus,
  floatingLabelFixed,
  ...custom
}) => {
  return (
    <TextField
      id={id}
      defaultValue={defaultValue}
      autoFocus={autoFocus}
      floatingLabelText={label}
      floatingLabelFixed={floatingLabelFixed}
      errorText={touched && (error || customError)}
      multiLine={multiLine}
      hintText={hintText}
      rowsMax={rowsMax}
      disabled={disabled}
      fullWidth={true}
      className="valuefont"
      autoComplete='new-type'
      onChange={(event) => onChange}
      maxLength={maxLength}
      floatingLabelStyle={{ top: '30px', color: '#7a7a7a' }}
      floatingLabelFocusStyle={{ color: '#01B9C1' }}
      style={{ height: '62px ' }}
      inputStyle={{ marginTop: '10px' }}
      {...input}
      {...custom}
    />

  );
};





export class Login extends Component {
  constructor() {
    super();
    this.state = ({

    });

    this.onSubmit = this.onSubmit.bind(this);
  }

  componentWillMount(){
    let masterData = {masterData: 'masterLocation'};
    // this.props.getMasterData(masterData);
  }

  onSubmit(formData){
      debugger;
  }
  render() {
    const { handleSubmit } = this.props;
    return (
      <div>
            <div className="readmin-panel">
                    <div className="page_header col-12">
                        <div className="row">
                            <div className="col-sm-12 text-right useful_btns">
                                <h2 className="page_title">Customized Components</h2>
                            </div>
                        </div>
                    </div>
                    <div className="panel-body">
                        <form className="readmin-form custom_form" onSubmit={handleSubmit(this.onSubmit.bind(this))}>
                            <div className="row p-2">


                               <div className="col-sm-4 col-md-4 mt-30">
                                    <Field
                                        name="name"
                                        label="name"
                                        // onChange = {(e)=>{console.log(e.target.value)}}
                                        component={renderTextField}/>
                               </div>

                           </div>
                           <button type="submit"className="btn btn-primary">submit</button>
                        </form>
                    </div>
            </div>
       </div>
    );
  }
}
function mapStateToProps(state) {
  return null;
}

Login = reduxForm({
    form: 'editForm' 
  })(Login)

export default connect(mapStateToProps, {})(Login);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...