Skip to content

Commit

Permalink
fixed cursor prop bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maxeth committed Apr 16, 2021
1 parent adabb51 commit 105c4cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ const TypeAnimation = ({
cursor = true
}) => {
const typeRef = useRef(null);
const classNames = [styles.type];
const baseStyle = styles.type;

let finalClassName;

if (className && className.length > 0) {
if (!cursor) {
finalClassName = className;
} else {
classNames.push(className);
finalClassName = classNames.join(' ');
finalClassName = `${baseStyle} ${className}`;
}
} else {
if (!cursor) {
finalClassName = '';
} else {
finalClassName = baseStyle;
}
}

Expand Down

0 comments on commit 105c4cb

Please sign in to comment.