0
30/07/2024 6:20 am
Topic starter
Below issue was faced while running testcase.
Test suite failed to run tests /step-definitions/CustomisableUserProfiles.web.steps.tsx:91:26 - error TS2786: 'CustomisableUserProfiles' cannot be used as a JSX component. Its instance type 'CustomisableUserProfiles' is not a valid JSX element. The types returned by 'render()' are incompatible between these types. Type 'Element' is not assignable to type 'ReactNode'. Property 'children' is missing in type 'Element' but required in type 'ReactPortal'. Wrapper = shallow(<CustomisableUserProfiles {...screenProps} />); ../../../node 378 modules/@types/react-native/node_modules/@types/react/ts5.0/index.d.ts:378:9 children: ReactNode; 'children' is declared here. tests /step-definitions/CustomisableUserProfiles.web.steps.tsx:292:43 used as a JSX component. Its instance type 'CustomisableUserProfiles' is not a valid JSX element. 292
This topic was modified 5 months ago by Lps75
1 Answer
0
30/07/2024 6:25 am
Topic starter
Inside block tsconfig.base.json file,add below lines in “compilerOptions” object.
"baseUrl": "./", "paths": { "react": [ "../node_modules/@types/react" ] },