-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Typescript #331
base: master
Are you sure you want to change the base?
Update Typescript #331
Conversation
eec55f2
to
a03332d
Compare
a03332d
to
90739a5
Compare
873a6f0
to
e93f61e
Compare
src/ts/types.ts
Outdated
export interface ComponentProps { | ||
/** | ||
* Set the component to render a different element type. | ||
*/ | ||
component?: string; | ||
component?: ReactType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is deprecated (and I don't think correct). You want an explicit list of available elements really... I can't remember where I've got this from before...
You may be able to use keyof IntrinsicElements
or Pick<keyof IntrinsicElements , 'div' | 'span' | 'etc etc'>
.
Or just manually define them: div | span | etc etc
tests/index.tsx
Outdated
@@ -49,7 +49,7 @@ describe('index file', () => { | |||
|
|||
for (const key in index) { | |||
if (index.hasOwnProperty(key)) { | |||
const Component = index[key as Keys]; | |||
const Component = index[key as Keys] as ReactType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come this is necessary?
https://trello.com/c/FkPWevtY/79-roe-typescript-upgrade
react-docgen-typescript
component
Note: Not related to TS upgrade, but also added whitespace to group imports