react-typed
react-typed copied to clipboard
We need react 17 support
Agreed. Any chance this can get traction?
Can easily be solved by implementing this wrapper on your own - it's ~30 lines.
import { useEffect, useRef, VoidFunctionComponent } from "react";
import { default as TypedLib } from "typed.js";
const Typed: VoidFunctionComponent<{ options: any }> = ({options}) => {
const ref = useRef<HTMLSpanElement | null>(null);
useEffect(() => {
if (! ref.current) {
return;
}
const typed = new TypedLib(ref.current, options);
return () => {
if (!typed) {
return;
}
typed.destroy();
};
}, [ref, options]);
return (
<div>
<span ref={ref} />
</div>
);
};
export default Typed;
any
sucks, I know, but unfortunately TypedOptions
are not exported (see https://github.com/mattboldt/typed.js/pull/494)
Perhaps update the README with https://github.com/ssbeefeater/react-typed/issues/26#issuecomment-983953018 and mark this package as deprecated
?
I implemented the wrapper and ditched the package. Problem solved.