I've a logging HOC:
export const hasLogger = (prefix = '') => WrappedComponent => {
const HasLogger = props => {
console.log(`${prefix}[Props]:`, props)
return <WrappedComponent {...props} />
}
and a simple component
export const SomeComponent2 = props => <Text>{props.x + props.y}</Text>
While I am still thinking on the best way to validate it, but the test crashes at the render level itself:
with an error "Can't access .root on unmounted test renderer"
describe('HoC component', () => {
it('logs props with withlogging', () => {
const { getByText } = render(hasLogger('')(<SomeComponent2 x={4} y={7} />))
})
})
Any thoughts on a mistake I'm making or it's a library issue?
I've a logging HOC:
and a simple component
While I am still thinking on the best way to validate it, but the test crashes at the render level itself:
with an error "Can't access .root on unmounted test renderer"
Any thoughts on a mistake I'm making or it's a library issue?