downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

オープン

#1,030 opened on 2020/04/30

 (4 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (980 件のフォーク)batch import
TypeScripthelp wanted

Repository metrics

Stars
 (11,761 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド