React Input Type not editable

后端 未结 3 1188
慢半拍i
慢半拍i 2020-12-14 18:12

I was adding dynamic values to the input file in react then I tried to edit that but it not at all editable.

var shop_profile_data = this.state.data.DETAILS         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 18:19

    The below code show how we can make an input tag editable in reactjs.

    import React from 'react';
    import { render } from 'react-dom';
    
        class App extends React.Component{
          constructor(props){
            super(props);
            this.state = {
              data: 2016
            }  
          }
          _handleChangeEvent(val) {
            return val;
          }
          render(){
            return (
              
    {this._handleChangeEvent(this.state.data);}} defaultValue={this.state.data} />
    ); } } render(, document.getElementById('app'));

提交回复
热议问题