最終更新:2022-09-22 (木) 11:04:03 (14d)  

React/ref
Top / React / ref

class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.myRef = React.createRef();
  }
  render() {
    return <div ref={this.myRef} />;
  }
}

useRef

  • const refContainer = useRef(initialValue);

関連