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

JSX element type 'ReactElement | null' is not a constructor function for JSX elements

$
0
0

I have simple Paragraph component set up in a following way

import * as React from 'react';import {Text} from 'react-native';const { memo } = React;/** * Component */function Paragraph({ children }) {  return (<Text>      {children}</Text>  );}export default memo(Paragraph);

Whenever I use <Paragraph /> in my application I receive following error from typescript:

JSX element type 'ReactElement | null' is not a constructor function for JSX elements. Type 'ReactElement' is not assignable to type 'Element'.ts(2605)

This happens to a lot of my elements and started happening since I updated to lates typings for react and react-native from definitely typed. I'm unable to pinpoint a change that might be causing this error.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>