downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

Aberta

#1.030 aberto em 30 de abr. de 2020

 (4 comentários) (1 reação) (0 responsável)JavaScript (980 forks)batch import
TypeScripthelp wanted

Métricas do repositório

Stars
 (11.761 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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

Guia do colaborador