Closed afilp closed 2 years ago
This isn't a TypeScript error, but rather a feature/bug of your IDE. Can you confirm this?
Thanks @WiXSL . Not sure how I can confirm this, does anyone of you use WebStorm to see if they experience the same?
I'm using PHPStorm and I don't have any messages of the sort. Since it's not a code error but an IDE related one I'm closing this issue.
I have the same issue. And this has been going on for at least 2 years.
This really looks like a WebStorm issue as I've never experienced it in VSCode.
Besides, I have no idea what the error means:
Element TextInput doesn't have required attribute name
The TypeScript prop type for TextInput
marks the name
prop as optional. There is no required name
in the propTypes.
In other terms, we have no way of reproducing this bug, and there is no reason it appears based on the code.
I really believe this is a bug in your IDE.
Did you open an issue in the WebStorm issue tracker?
@fzaninotto I think almost the same that you. Actually I did not, because somebody else did it 2 months ago.
@afilp In the tooltip - what occurs on hover of the tag - there is a More actions...
, you can choose that the IDE should not mark the name as a required field. It seems in the last 2 years this did not gives me enough pain to click 2, to solve this frustrating problem.
After this, there is another problem here. I do not know exactly, what did I switched off. :smile: Maybe this was not a bug, instead of a feature, or the IDE confused with another markup than JSX or so... At least, after the change, my all react-admin related code is clean. :partying_face:
Interesting... In the screenshot of the WebStorm issue you linked, I read "Kotlin detected". I believe the IDE mixes up JSX for another language, which explains that it misinterprets the code.
Anyway, thanks for the feedback, and happy you got it solved on your side.
What you were expecting:
No warnings on
<TextInput />
What happened instead:
Webstorm shows this on all occurences:
Steps to reproduce:
Just using TextInput.
Related code:
Environment
React-admin version: "react-admin": "^4.0.0-beta.1" Last version that did not exhibit the issue (if applicable): React version: "react": "^17.0.2" Browser: Stack trace (in case of a JS error):