mirror of
https://github.com/Spythere/spythere-portfolio.git
synced 2026-05-02 21:18:15 +00:00
22 lines
496 B
TypeScript
22 lines
496 B
TypeScript
import { ReactNode, useRef } from 'react';
|
|
import { StyledAnimatedText } from './styles/AnimatedText.styled';
|
|
|
|
interface IProps {
|
|
children: ReactNode;
|
|
}
|
|
|
|
export default function AnimatedText(props: IProps) {
|
|
const test = useRef<HTMLElement>(null);
|
|
|
|
// useEffect(() => {
|
|
// console.log(test.current?.textContent);
|
|
// }, [test]);
|
|
|
|
return (
|
|
<StyledAnimatedText>
|
|
<span ref={test}>{props.children}</span>
|
|
<span className="cursor"></span>
|
|
</StyledAnimatedText>
|
|
);
|
|
}
|