downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

Aperta

#1030 aperta il 30 apr 2020

 (4 commenti) (1 reazione) (0 assegnatari)JavaScript (980 fork)batch import
TypeScripthelp wanted

Metriche repository

Star
 (11.761 stelle)
Metriche merge PR
 (Merge medio 6g 9h) (5 PR mergiate in 30 g)

Descrizione

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

Guida contributor