Why Material-UI Appbar onLeftIconButtonTouchTap is not work?

前端 未结 1 1991
南旧
南旧 2021-01-20 16:47

Im studying React-Redux, Material-UI.
Now, Im trying to create Sample App, but not work.
I dont know how to improve my code.
I want to open Drawer , when Materia

相关标签:
1条回答
  • 2021-01-20 17:31

    You are not binding the function correctly. You need to update your code to

    <AppBar
      title='sample'
      onLeftIconButtonTouchTap = { openDrawer.bind(this) }
    />
    

    More about .bind() method here: Use of the JavaScript 'bind' method

    0 讨论(0)
提交回复
热议问题