diff --git a/packages/preact/constants.ts b/packages/preact/constants.ts index c96a6c0659..11402078b9 100644 --- a/packages/preact/constants.ts +++ b/packages/preact/constants.ts @@ -1,3 +1,10 @@ +import { useEffect } from 'preact/hooks'; + export const RENDER_SCOPE = 'slot'; export const SVG_RENDER_SCOPE = 'g'; export const REACT_ROOT = '__react_root'; + +export const Effect = ({ effect }: { effect: () => void }): null => { + useEffect(effect, []); + return null; +};