downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

Open

#1,030 创建于 2020年4月30日

在 GitHub 查看
 (4 评论) (1 反应) (0 负责人)JavaScript (11,761 star) (980 fork)batch import
TypeScripthelp wanted

描述

  • downshift version:
  • node version:
  • npm (or yarn) version:

Relevant code or config

What you did:

What happened:

Reproduction repository:

Problem description: Since we use items/selectedItems just for some logic and we do not tamper with them, we can mark them as read only in the TS interface.

Suggested solution: In typings.ts for useSelect, useCombobox and useMultipleSelection, use Readonly to wrap the items type.

贡献者指南