0.0.3 • Published 4 months ago
react-component-instance v0.0.3
react-component-instance
Get a React class component instance from its DOM
element
import getInstance from 'react-component-instance'
With @testing-library/react
Note that for use with Testing Library import from react-component-instance/container
import getInstance from 'react-component-instance/container'
import {
render
} from '@testing-library/react'
const {
container
} = render(
<Component />
)
const instance = getInstance(container)