Skip to content

Commit

Permalink
Merge pull request #37 from Kalita-Roman/Add_tag
Browse files Browse the repository at this point in the history
Add the opportunity to choose a tag.
  • Loading branch information
CezaryDanielNowak authored Feb 21, 2018
2 parents b7cf970 + 6708147 commit 11ba067
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Dotdotdot props:

**truncationHTML**: String of HTML to use instead of truncationChar

**tagName**: [default: `div`] (String). The type of HTML tag which will wrap the component's content.

Notes
-----------------
React-dotdotdot is simple plugin, if you need more functionality, consider using react-truncate
Expand Down
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Dotdotdot.prototype.update = function() {

Dotdotdot.prototype.render = function() {
return React.createElement(
"div",
this.props.tagName,
{
ref: this.getContainerRef,
className: this.props.className
Expand All @@ -72,12 +72,14 @@ Dotdotdot.propTypes = {
]).isRequired,
truncationChar: PropTypes.string,
useNativeClamp: PropTypes.bool,
className: PropTypes.string
className: PropTypes.string,
tagName: PropTypes.string
};

Dotdotdot.defaultProps = {
truncationChar: '\u2026',
useNativeClamp: true
useNativeClamp: true,
tagName: 'div'
};

module.exports = Dotdotdot;

0 comments on commit 11ba067

Please sign in to comment.