downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

Open

#1030 aperta il 30 apr 2020

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

Metriche repository

Star
 (11.761 star)
Metriche merge PR
 (Merge medio 4g 9h) (7 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