学习资源推荐

ref

import React  from 'react';
class App extends React.Component {
  constructor(props) {
    super(props);
    this.myref=React.createRef();
  }
  
  componentDidMount(){
   this.myref.current.style.backgroundColor="#000"
  }
  render() {
    return (
      <input ref={this.myref} defaultValue="我是输入框" style={{color:'white'}}/>
    );
  }
}

export default App;