Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6215

TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf () in react native

$
0
0
//Super.tsxclass Super extends React.Component {    someMethod = () => {    }}export { Super };//ClassA.tsximport {Super} from '../Super';class ChildA extends Super {    componentDidMount() {        this.someMethod();    }}//ClassB.tsximport {Super} from '../Super';class ChildB extends Super {    componentDidMount() {        this.someMethod();    }}//ClassC.tsximport {Super} from '../Super';class ChildC extends Super {    componentDidMount() {        this.someMethod();    }}//ClassA.test.tsximport { ClassA } from '../ClassA'describe('ClassA', () => {    let wrapper: any;    let instance: any;    const props = createTestProps({});    beforeEach(() => {        wrapper = shallow<ClassA>(<ClassA {...props} />);        instance = wrapper.instance()    });})

Functionally it is working fine, but when i ran the jest unit test cases i am getting TypeError: Object prototype may only be an Object or null: undefinedat setPrototypeOf () error. Please suggest any solution.Thanks


Viewing all articles
Browse latest Browse all 6215

Trending Articles