downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

开放

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

 (4 条评论) (1 个反应) (0 位负责人)JavaScript (980 个派生)batch import
TypeScripthelp wanted

仓库指标

星标
 (11,761 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

  • 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.

贡献者指南