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
Error : JSX element t.tag does not have construct or call signatures.
I guess its valid to tag if the variable resolves to a string instead of a Call/Construct.
Warning
But not if its not dotted e.g. the following :
consttag='h1';constfoo=<tag/>
is actually creating a React.createElement("tag") and not React.createElement("h1"). To be honest this whole use a string to point to what you want feels wrongish to me.
Type
Note : The type will probably have to resolve to any at least to begin with and it is going to be a pain 🌹
For variable (including const) that has string type, it will be resolve to anyType (i.e we will not check if the string actually has valid Jsx intrinsic element type).
For variable with string literal type, we will check whether this string literal type is actually a valid Jsx intrinsic element type.
So in both examples pointed out by Rylan Hawkins (@RylanH) and Basarat Ali Syed (@basarat) , the type will be anyType and no error should be reported. if you would like a tighter check, you will want to give it a string literal type
Activity
basarat commentedon May 11, 2016
Another:
Error : JSX element t.tag does not have construct or call signatures.I guess its valid to tag if the variable resolves to a
stringinstead of aCall/Construct.Warning
But not if its not
dottede.g. the following :is actually creating a
React.createElement("tag")and notReact.createElement("h1"). To be honest this whole use a string to point to what you want feels wrongish to me.Type
Note : The type will probably have to resolve to
anyat least to begin with and it is going to be a pain 🌹yuit commentedon Jun 14, 2016
Nathan Shively-Sanders (@sandersn) could i take this bug ?
sandersn commentedon Jun 14, 2016
Sure, I haven't looked at it at all.
yuit commentedon Jun 23, 2016
Update on the decision we made, after talk with Ryan Cavanaugh (@RyanCavanaugh) about this. We made following decision:
So in both examples pointed out by Rylan Hawkins (@RylanH) and Basarat Ali Syed (@basarat) , the type will be anyType and no error should be reported. if you would like a tighter check, you will want to give it a string literal type