this repo has no description
1import { useEffect, useState } from 'preact/hooks';
2
3function AsyncText({ children }) {
4 if (typeof children === 'string') return children;
5 const [text, setText] = useState('');
6 useEffect(() => {
7 Promise.resolve(children).then(setText);
8 }, [children]);
9 return text;
10}
11
12export default AsyncText;