question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect type definitions for Select interface

See original GitHub issue

Expected Behavior

The latest version should be consumable from a TS project. The property definitions for the Select component should be correct:

...
disabledKey?: string | ((...args: any[]) => any);
...

Actual Behavior

When using grommet components TypeScript throws an error:

/node_modules/grommet/components/Select/index.d.ts
Type error: Type expected.  TS1110

     9 |   closeOnChange?: boolean;
    10 |   disabled?: boolean | number | string | object[];
  > 11 |   disabledKey?: string | (...args: any[]) => any;
       |                           ^
    12 |   dropAlign?: {top?: "top" | "bottom",bottom?: "top" | "bottom",right?: "left" | "right",left?: "left" | "right"};
    13 |   dropTarget?: object;
    14 |   focusIndicator?: boolean;

URL, screen shot, or Codepen exhibiting the issue

In the official TypeScript playground

Steps to Reproduce

  1. create-react-app
  2. add any tsconfig.json
  3. run the application

Your Environment

  • Grommet version: 2.1.1
  • Browser Name and version: any
  • Operating System and version (desktop or mobile): desktop/Windows 10

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
alansouzaticommented, Dec 12, 2018

We can release a bug fix soon. let me target friday since there are other minor fixes that can be included.

3reactions
oorestisimecommented, Dec 12, 2018

hey, i am just a happy contributor to grommet 😃 this is more of a question to the maintainers cc @alansouzati @ericsoderberghp @ShimiSun

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript incorrect type inference when class implements ...
In order to do this I need to create some complex interfaces and then for my classes (I use classes in order not...
Read more >
Incorrect error message when incorrectly implementing interface
It is normal to set a interface type to a concrete class that implements the interface, and there should never be an error...
Read more >
Handbook - Interfaces - TypeScript
In TypeScript, interfaces fill the role of naming these types, and are a powerful way of defining contracts within your code as well...
Read more >
TypeScript: type vs interface - DEV Community ‍ ‍
Let's figure out what the difference between types and interfaces once ... interface ISelectableControl extends Control { select(): void; } ...
Read more >
Surviving the TypeScript Ecosystem — Part 4 - Medium
Now we can remove our incorrect module definition for lodash (delete the contents, but keep the file, in “modules.d.ts”). import * as lodash...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found