zucchetti-sa5/themes/onepirate/modules/form/defer.js

16 lines
303 B
JavaScript
Raw Normal View History

2022-10-28 11:41:58 +02:00
import * as React from 'react';
export default function defer(Component) {
function Defer(props) {
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
return <Component mounted={mounted} {...props} />;
}
return Defer;
}