Level 1
A few things to check,
- Make sure React typings are installed
- Check file extensions
- Verify TypeScript service
- JSX setting in tsconfig
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?
Please or to participate in this conversation.