Skip to content

Comments

Fix TypeScript implicit type errors in SearchableDropdown tests#2355

Merged
nishthaAhujaa merged 2 commits intousers/nishthaahuja/searchableDropdownfrom
copilot/sub-pr-2312
Jan 27, 2026
Merged

Fix TypeScript implicit type errors in SearchableDropdown tests#2355
nishthaAhujaa merged 2 commits intousers/nishthaahuja/searchableDropdownfrom
copilot/sub-pr-2312

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Fixed TS7018 compilation errors where TypeScript couldn't infer generic types from null and empty array literals in test props.

Changes

  • Added explicit type annotation null as TestItem | null for selectedItem property in default test props
  • Added explicit type annotation [] as TestItem[] for items property in empty items test case
const defaultProps = {
  // ...
  selectedItem: null as TestItem | null,  // was: null
  // ...
};

const propsWithEmptyItems = {
  // ...
  items: [] as TestItem[],  // was: []
};

This allows TypeScript to properly infer the generic type parameter T in SearchableDropdownProps<T>.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: nishthaAhujaa <45535788+nishthaAhujaa@users.noreply.github.com>
Copilot AI changed the title [WIP] Update searchable dropdown component styles Fix TypeScript implicit type errors in SearchableDropdown tests Jan 27, 2026
Copilot AI requested a review from nishthaAhujaa January 27, 2026 09:54
@nishthaAhujaa nishthaAhujaa marked this pull request as ready for review January 27, 2026 10:12
@nishthaAhujaa nishthaAhujaa requested a review from a team as a code owner January 27, 2026 10:12
@nishthaAhujaa nishthaAhujaa merged commit 6d0d9ba into users/nishthaahuja/searchableDropdown Jan 27, 2026
1 check passed
@nishthaAhujaa nishthaAhujaa deleted the copilot/sub-pr-2312 branch January 27, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants