MCPcopy Create free account
hub / github.com/testing-library/react-testing-library / NativeEventElement

Function NativeEventElement

src/__tests__/events.js:187–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185 const Element = elementType
186
187 const NativeEventElement = () => {
188 React.useEffect(() => {
189 const element = ref.current
190 element.addEventListener(nativeEventName, spy)
191 return () => {
192 element.removeEventListener(nativeEventName, spy)
193 }
194 })
195 return <Element ref={ref} />
196 }
197
198 render(<NativeEventElement />)
199

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…