Skip to content

Commit

Permalink
Don't use React.DOM.div and friends [fixes #7]
Browse files Browse the repository at this point in the history
  • Loading branch information
martinandert committed Jul 25, 2017
1 parent bd8d178 commit f29b6d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ var Lorem = createReactClass({
random.seed(props.seed);

var html = loremIpsum(props);
var wrapper = React.DOM.div;
var wrapper;

if (props.mode === 'list') {
html = html.replace(/<p>(.*?)<\/p>/g, '<li>$1</li>');

if (props.ordered) {
wrapper = React.DOM.ol;
wrapper = React.createFactory('ol');
} else {
wrapper = React.DOM.ul;
wrapper = React.createFactory('ul');
}
} else {
wrapper = React.createFactory('div');
}

props.dangerouslySetInnerHTML = { __html: html };
Expand Down

0 comments on commit f29b6d0

Please sign in to comment.