Tab: browser throwing a warning - getInitialState
See original GitHub issueSteps to Reproduce
- Using the Tab component and importing it to my page
Expected The Tab should do this: there shouldn’t be any errors or warnings
Result The Tab does not do this: the browser gives a warning:
Warning: getInitialState was defined on Tab, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?
The Tab.js (in the semantic-ui-react node_module) is using getInitialState which is not used in ES6
getInitialState() {
return { activeIndex: 0 }
}
Could you please help me with this if there is a way to fix this or is changing the syntax to ES6 by using constructor and assigning the state is the only way to go? Thanks!
Testcase If the docs show the issue, use: https://react.semantic-ui.com/modules/tab#tab-example-secondary-pointing Otherwise, fork this to get started: http://codepen.io/levithomason/pen/ZpBaJX
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hm, I can’t reproduce this on
15.5
, however warning really exists on15.4
.I will make PR.
@layershifter @levithomason you guys are awesome and thanks for picking up this so fast and fixing it 👍