JussiMannisto's avatar

PhpStorm not recognizing built-in React props

I'm having an issue with .tsx React components in PhpStorm 2025.2.5. When I define component props explicitly, the IDE doesn't recognize special React props such as key and reports them as invalid. Take this mock example of a Groups component that renders a list of Group components:

// Groups.tsx:
import React from 'react';
import type { ContactGroup } from '@/Types/ContactGroup.ts';
import Group from "./Group";

type Props = {
	groups: ContactGroup[],
}

function Groups(props: Props) {
	return (
		<div>
			{props.groups.map(group =>
				<Group key={group.id} group={group} />
			)}
		</div>
	);
}

export default Groups;
// Group.tsx:
import React from 'react';
import type {ContactGroup} from "@/Types/ContactGroup";

type Props = {
	group: ContactGroup,
}

function Group(props: Props) {
	return (
		<div>
			{props.group.name}
		</div>
	);
}

export default Group;

PhpStorm shows "Unresolved component prop 'key'". I'm using the bundled JS/TS and React plugins. Any ideas on how to fix this?

prop.png

0 likes
2 replies
mileswebhosting's avatar

A few things to check,

  • Make sure React typings are installed
  • Check file extensions
  • Verify TypeScript service
  • JSX setting in tsconfig
JussiMannisto's avatar

Can you be a bit more specific? What you you mean by "React typings" being installed, and about the JSX settings in tsconfig.js? I've set jsx to react-jsx.

Please or to participate in this conversation.