react-select icon indicating copy to clipboard operation
react-select copied to clipboard

TypeScript Examples for V2?

Open 129emma opened this issue 7 years ago • 7 comments

Hi, just wondering if it's possible we could have typescript live example for v2? I've faced many issues on that but couldn't find any examples for TypeScript.

Thanks!

129emma avatar Apr 11 '19 22:04 129emma

It is weird to have a typing library for react-select and not be able to do anything with it. How do you guys customize components for a select if you're using typescript? What type hosts innerProps?

georgeshevtsov avatar May 07 '19 12:05 georgeshevtsov

Running into this same issue. Can't import/extend anything out of @types. Seems silly to have to write them all out when they are already defined.

tx-steven avatar Jun 19 '19 22:06 tx-steven

Any updates on this issue?

MaxDonchenko avatar Jul 23 '19 08:07 MaxDonchenko

@goodwin64 I was able to solve my problem by importing the types I needed from this path: react-select/src/Select. Doesn't really solve the issue but it is a workaround if you need to access types.

tx-steven avatar Jul 23 '19 18:07 tx-steven

I was struggling with this too... After some digging around DefinitelyTyped, i found an examples/ directory where they import type definitions like this:

import { OptionsType } from 'react-select/src/types';

It's not what i expected, but seems to be the way the authors defined the type-defs 🤷‍♂️

danieldelcore avatar Oct 03 '19 23:10 danieldelcore

@gwyneplaine, Might be worth closing this issue now since the import structure of @types/select has been changed to avoid requiring users to import like this:

import { OptionsType } from 'react-select/src/types';

to this:

import { OptionsType } from 'react-select';

danieldelcore avatar Nov 06 '19 01:11 danieldelcore

Thanks @danieldelcore love your work, issue closed

gwyneplaine avatar Nov 11 '19 03:11 gwyneplaine