enzyme
enzyme copied to clipboard
Getting issue with mounting the component
My component is having ref, so I have tried to render the component by mount
But I am getting the following errors
Const wrapper = mount (<MyGraph {...componentProps} />); ^ Element type is invalid : expected a string (for built-in components ) or a class / function (for composite components) but got: undefined . you likely forgot to export your component from the file it’s defined in or you might have mixed up default and named imports
The minimal component structure is
leftClick(){
this.ref.scrollview.scrollTo()
}
reder() {
return (
<View>
----
<ScrollView refs="scrollview" ---- ><View></View><ScrollView>
</View>)
}
Note: I am sure that no issues with imports and code. The same component is working with shallow rendering except for refs, so I have moved to 'mount'
I'd hope it's render
and not reder
, but either way i'd need the entirety of the component and test code. Additionally, please fill out the entire issue template; that's why it's there.