Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "react-typist",
"version": "2.0.4",
"version": "2.0.5",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you remove these changes? I'll update the version when I publish a new version separately

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in my last commit. Thank you

"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",
Expand Down
9 changes: 6 additions & 3 deletions src/Typist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -24,6 +25,7 @@ export default class Typist extends Component {
}

static defaultProps = {
container: 'div',
className: '',
avgTypingDelay: 70,
stdTypingDelay: 25,
Expand Down Expand Up @@ -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 (
<div className={`Typist ${className}`}>
<ContainerTag className={`Typist ${className}`}>
{innerTree}
<Cursor isDone={isDone} {...cursor} />
</div>
</ContainerTag>
);
}

Expand Down