forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[added] react-bootstrap#1181 ListGroup supports componentClass prop
- Loading branch information
Showing
5 changed files
with
254 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const CustomComponent = React.createClass({ | ||
render() { | ||
return ( | ||
<li | ||
className="list-group-item" | ||
onClick={() => {}}> | ||
{this.props.children} | ||
</li> | ||
); | ||
} | ||
}); | ||
|
||
const listgroupInstance = ( | ||
<ListGroup componentClass="ul"> | ||
<CustomComponent>Custom Child 1 </CustomComponent> | ||
<CustomComponent>Custom Child 2 </CustomComponent> | ||
<CustomComponent>Custom Child 3</CustomComponent> | ||
</ListGroup> | ||
); | ||
|
||
React.render(listgroupInstance, mountNode); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.