Incorrect warning for React Component

已回答

IDE: IntelliJ Ultimate

When I copy and paste the following code into IntelliJ, suspicious warning appears.

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSYBPMJOABRzAGcAeASQBE4kAPGJAHYATJnCYwowAQHMAfHAC8cAN6k4cAG4oANgFckTAFxxOAbQC6AblIBfOADI4AClXqwKIgJhshx8ZJkLa3UIAQBhAAsUGSRjJyQNQRhjZThgIQB+YwEEpChLOHdPb18xCSlpODsAHxU00v8KgBpCjySfLLgcxKgqgEpFeQ0IdNs4WtdW4o7s3Py1OFDI6OlY51yvFPq-cpkCovbM2Z7+wc0RoWsbPvIqGnpGJgAmRRUFrT0DHYDpILHHFwLA5eHzfCp-ELhKIxOIbZJ1dKdbp5fZtEENXaVGoIjE-FrAkpIuanBRDC5jCZAtGE44ohZLaGrWGJTY4sF7KaHIkna5nYbpK43UiYXQCDDAUJwMK4SA5LxOMCPYwMCDMFiNGSyAaTIgwXRQASFR4AOg++iYxu0gmkMAitnIIrFMAlhul4FCSSeCqVD1Vz21C11+sNir9pp05st1tt9tIvEgsDgjvFkoAgmAwE4A+ogwbnAt1CwhMANLIC+o4Cw3bLPZoIwYFMoLHYGSskI2s2dlDYbAB6MsVitVmUerx1z5MRvNxZQtsdgaklQ9-vlli94ulhY3GxAA

 

“Element Component doesn't have required attribute patientId” message appears, but the component don't have to receive the props.

This message appears only when I use generic props. For example, “Component2” in the following code can be rendered I expected.

0

Which IDE version do you use? Is TS service enabled in `Settings | Languages & Frameworks | TypeScript`?

0

请先登录再写评论。