onClick, чтобы менять State и оно не функционирует

У меня есть составляющее меню. Этот, путь css меняется в типичное меню мобильного телефона с гамбургером и списком статей в колонне.

из-за default, поскольку это очевидно, одинокий он является гамбургером, и я хочу, чтобы, кликнув в этом гамбургере, он добавил некие классы к неким divs, для того, чтобы этот он появился.

Я думаю, что я не определяю постоянные величины как дебет того, чтобы быть (я думаю, что это неудача), но не знаю, как переходить.

я оставляю вам код компонента:

export class MenuComponent extends Component{


constructor(props){
       super(props);
       this.state  = {
           menuMobile: true
       }
   }
   openMenuMobile(){
       this.setState({menuMobile:false});
       console.log(this.state.menuMobile)
   }

render() {
    const clickedMenuToggle = this.state.menuMobile ? 'menu-toggle' : 'menu-toggle dark-menu';
    const clickedToggle = this.state.menuMobile ? 'toggle' : 'toggle opened';
    const clickedMenuMobile = this.state.menuMobile ? 'menu-mobile' : 'menu-mobile menu-mobile-opened';
    const clickedItemLi = this.state.menuMobile ? '' : 'item-li-opened';
    const clickedItemLia = this.state.menuMobile ? 'a-item-mobile' : 'a-item-mobile item-a-opened';

    return(
        <header>
            <div className={clickedMenuToggle}>
                <section className="content-mobile-menu">
                    <div className={clickedToggle}>
                        <div className="hamburger" onClick={this.openMenuMobile}>
                            <span></span>
                            <span></span>
                            <span></span>
                        </div>
                        <div className="ex">
                            <span></span>
                            <span></span>
                        </div>
                    </div>
                    <img className="logo-mobile" width="70" height="100" alt="Prrrcl Logo"
                         src={Logo} />
                    <div className="arrow-to-top">
                        <img
                            src="" alt={'Click to top'}/>
                    </div>
                </section>
            </div>
            <ul className={clickedMenuMobile}>
                <li className={clickedItemLi}>
                    <Link to={'/home'} className={clickedItemLia}><span>home</span></Link>
                </li>
            </ul>

            <nav className="header-nav not--clickable">
                <ul className="ul-menu">
                    <ItemMenu url={'/'} children={'home'}/>
                    <ItemMenu url={'/projects'} children={'projects'}/>

                    <li>
                        <img id="logo--header" width="90" alt="Prrrcl Logo" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNv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3NjQsMjY5LjMzMDU1IHYgLTc5LjYyNTkxIGggLTE3LjQ4NCB2IDc5LjYyNTkxIHoiIC8+CiAgPC9nPgo8L3N2Zz4K"/>
                    </li>
                    <ItemMenu url={'/cv'} children={'cv'}/>

                    <ItemMenu url={'/contact'} children={'contact'}/>
                </ul>
            </nav>
        </header>
    )
}

}

0
задан 20.03.2019, 12:10
1 ответ

Ты должен создавать binding в строителе для того, чтобы он смог брать функцию. Так как this в этом случае undefined, так как в JSX он отличается и поэтому он не призывает ее funciГіn.

constructor(props){
       super(props);
       this.state  = {
           menuMobile: true
       }
this.openMenuMobile = this.openMenuMobile.bind(this)
   }
2
ответ дан 02.12.2019, 05:22
  • 1
    Гениальный! точно то, в чем он нуждался. Большое спасибо. – Adrián 20.03.2019, 12:25
  • 2
    Не за что!!! @adrian. – Wilfredo 20.03.2019, 12:26

Теги

Похожие вопросы