반응에서 클래스 전환 메뉴 버튼이 있는 프로젝트에서 리액트를 사용하고 있습니다. Sidenav 컴포넌트는 다음과 같습니다. 그리고 메뉴를 전환하기 위해 다음과 같은 코드를 작성했습니다. class Header extends React.Component { constructor(props){ super(props); this.toggleSidenav = this.toggleSidenav.bind(this); } render() { return ( ) } toggleSidenav() { this.refs.btn.classList.toggle('btn-menu-open'); } componentDidMount() { this.refs.btn.addEventListener('click', this.toggleS..