MCPcopy Create free account
hub / github.com/ampproject/amphtml / AmpElementWithRef

Function AmpElementWithRef

test/unit/preact/test-slot.js:286–292  ·  view source on GitHub ↗
(props, ref)

Source from the content-addressed store, hash-verified

284 }
285
286 function AmpElementWithRef(props, ref) {
287 useLayoutEffect(() => {
288 const element = ref.current;
289 stubAmpElement(element);
290 }, [ref]);
291 return <amp-element ref={ref} {...props} />;
292 }
293
294 it('should load AMP elements on mount', () => {
295 const child1 = child1Ref.current;

Callers

nothing calls this directly

Calls 1

stubAmpElementFunction · 0.85

Tested by

no test coverage detected