diff --git a/package.json b/package.json index 5a0f39f..4205c3c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "2.0.4", "description": "Typing animations with React", "main": "dist/Typist.js", - "files": ["dist", "src"], + "files": [ + "dist", + "src" + ], "scripts": { "dist": "webpack --config webpack.dist.config.js", "standalone": "webpack --config webpack.standalone.config.js", diff --git a/src/Typist.jsx b/src/Typist.jsx index b779553..86854fc 100644 --- a/src/Typist.jsx +++ b/src/Typist.jsx @@ -13,6 +13,7 @@ export default class Typist extends Component { static propTypes = { children: PropTypes.node, className: PropTypes.string, + container: PropTypes.string, avgTypingDelay: PropTypes.number, stdTypingDelay: PropTypes.number, startDelay: PropTypes.number, @@ -24,6 +25,7 @@ export default class Typist extends Component { } static defaultProps = { + container: 'div', className: '', avgTypingDelay: 70, stdTypingDelay: 25, @@ -182,18 +184,19 @@ export default class Typist extends Component { } render() { - const { className, cursor } = this.props; + const { className, cursor, container } = this.props; const { isDone } = this.state; + const ContainerTag = container; const innerTree = utils.cloneElementWithSpecifiedText({ element: this.props.children, textLines: this.state.textLines, }); return ( -
+ {innerTree} -
+ ); }