Skip to content

Commit

Permalink
Removing JSX
Browse files Browse the repository at this point in the history
closes #14
  • Loading branch information
mzabriskie committed Jun 3, 2015
1 parent 83f8026 commit 8d47d98
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 35 deletions.
18 changes: 8 additions & 10 deletions lib/components/Tab.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @jsx React.DOM */
var React = require('react');

function syncNodeAttributes(node, props) {
Expand Down Expand Up @@ -35,15 +34,14 @@ module.exports = React.createClass({
},

render: function () {
return (
<li role="tab"
id={this.props.id}
aria-selected={this.props.selected ? 'true' : 'false'}
aria-expanded={this.props.selected ? 'true' : 'false'}
aria-controls={this.props.panelId}
>
{this.props.children}
</li>
return React.DOM.li({
role: 'tab',
id: this.props.id,
'aria-selected': this.props.selected ? 'true' : 'false',
'aria-expanded': this.props.selected ? 'true' : 'false',
'aria-controls': this.props.panelId
},
this.props.children
);
}
});
9 changes: 4 additions & 5 deletions lib/components/TabList.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/** @jsx React.DOM */
var React = require('react');

module.exports = React.createClass({
displayName: 'TabList',

render: function () {
return (
<ul role="tablist">
{this.props.children}
</ul>
return React.DOM.ul({
role: 'tablist'
},
this.props.children
);
}
});
18 changes: 8 additions & 10 deletions lib/components/TabPanel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @jsx React.DOM */
var React = require('react');

module.exports = React.createClass({
Expand All @@ -15,14 +14,13 @@ module.exports = React.createClass({
render: function () {
var children = this.props.selected ? this.props.children : null;

return (
<div role="tabpanel"
id={this.props.id}
aria-labeledby={this.props.tabId}
style={{display: this.props.selected ? '' : 'none'}}
>
{children}
</div>
);
return React.DOM.div({
role: 'tabpanel',
id: this.props.id,
'aria-labeledby': this.props.tabId,
style: {display: this.props.selected ? '' : 'none'}
},
children
);
}
});
17 changes: 7 additions & 10 deletions lib/components/Tabs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @jsx React.DOM */
var React = require('react/addons');
var invariant = require('react/lib/invariant');
var jss = require('js-stylesheet');
Expand Down Expand Up @@ -197,17 +196,15 @@ module.exports = React.createClass({

return result;
});

},

render: function () {
return (
<div className="react-tabs"
onClick={this.handleClick}
onKeyDown={this.handleKeyDown}
>
{this.getChildren()}
</div>
render: function () {
return React.DOM.div({
className: 'react-tabs',
onClick: this.handleClick,
onKeyDown: this.handleKeyDown
},
this.getChildren()
);
}
});

0 comments on commit 8d47d98

Please sign in to comment.