material ui Tabs unclickable

五迷三道 提交于 2019-12-20 05:52:14

问题


Tabs from material-ui are unclickable. Nothing happens then i click on them. Code is just simple:

 `var Tabs = React.createClass ({
   render: function() { 
    return (
        <Tabs>
            <Tab label="1">
              <p>hello 1</p>
            </Tab>
            <Tab label="2"/>
              <p>hello 2</p>
            </Tab>
        </Tabs>
    );
   }
  });`

But on the page i see theese tabs with first tab opened and then i click on the second nothing happens. Tried different browsers. What could go wrong?


回答1:


You must add this code:

var injectTapEventPlugin = require("react-tap-event-plugin");
injectTapEventPlugin();

I wonder why it is not explicitly mentioned in their examples.



来源:https://stackoverflow.com/questions/35190548/material-ui-tabs-unclickable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!