Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Adding an is prefix to a boolean param.
Browse files Browse the repository at this point in the history
(Looks awesome - can't wait to try it!)
  • Loading branch information
mishabosin committed Dec 30, 2014
1 parent 9c0d7ff commit 098e36f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
coverage/
.idea/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = React.createClass({
foo: this.props.foo,
bar: this.props.bar
},
rendered: this.props.foo // div won't render if rendered === false
isRendered: this.props.foo // div won't render if isRendered === false
})
])
);
Expand Down Expand Up @@ -50,6 +50,6 @@ Returns a React element

#### Special Properties

- **rendered** `Boolean` - If strictly to false, React will skip rendering the target component.
- **isRendered** `Boolean` - If strictly to false, React will skip rendering the target component.

- **className** `String|Object` - If the className value is an object, apply React.addons.classSet() automatically.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function r(component, properties, children) {
properties = {};
}

if (properties.rendered === false) {
if (properties.isRendered === false) {
// React skips the component rendering if render() returns null.
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/render-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = {
dom: (
r(Component, [
r.span(),
r.div({rendered: false})
r.div({isRendered: false}, 'Should not show up')
])
)
},
Expand Down

0 comments on commit 098e36f

Please sign in to comment.