Closed xiaoquisme closed 5 years ago
you’ll get a runtime error; the best practice imo is to make console warnings/errors fail your tests, and then your component’s tests should catch these.
Yes, a runtime error will always be ignored, because it does not affect the correct behaver. So the only way is to write a test to cover this. It's correct?
Yes.
Thanks a lot
Details: I have one react component some like this
This is correct.
case 1: but some of the Team members missing write
PropTypes
.It's ok, Eslint will tell him. case 2: some of the Team members will be writing like this
case 3: some of the Team Members will be writing like this
But for Case 2 and 3, Eslint will not tell me this is error and
Proptypes
not tell me the error in my IDE(such as WebStorm). so how to avoid this?