You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
Compiles. test has type JSX.Element. If test were rendered it would show
<div>1:2:<div>Hello World</div>3:</div>
Null wouldn't render anything, the first TestStateless would render it's content, the second wouldn't render anything.
Actual behavior:
If I try to use <TestStateless />, I get the following errors.
[ts] JSX element type 'Element | null' is not a constructor function for JSX elements.
Type 'null' is not assignable to type 'ElementClass'.
[ts] JSX element class does not support attributes because it does not have a 'props' property
The {null} part of the JSX works correctly.
The same issue happens if the functional component returns undefined
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.2.1
Code
Expected behavior:
Compiles.
test
has typeJSX.Element
. If test were rendered it would showNull wouldn't render anything, the first
TestStateless
would render it's content, the second wouldn't render anything.Actual behavior:
If I try to use
<TestStateless />
, I get the following errors.The
{null}
part of the JSX works correctly.The same issue happens if the functional component returns
undefined
The text was updated successfully, but these errors were encountered: