MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Component

Function Component

packages/react-aria/test/interactions/Pressable.test.js:82–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 it('should error if component does not forward its ref', async function () {
81 using spy = jest.spyOn(console, 'error').mockImplementation(() => {});
82 let Component = () => <button>Hi</button>;
83 render(
84 <Pressable>
85 <Component>Button</Component>
86 </Pressable>
87 );
88
89 expect(spy).toHaveBeenCalledWith('<Pressable> child must forward its ref to a DOM element.');
90 });

Callers

nothing calls this directly

Calls 1

renderFunction · 0.50

Tested by

no test coverage detected