Typescript support for defining component Interface through React interface
See original GitHub issueI’m playing around with the playground and noticed that if you type your component in this way const MyComponent: React.FC<IProps> = ..
, react-docgen doesn’t pick up the interface in IProps
.
I’m curious to know if there’s a specific reason for this, and if support for this might be on the roadmap.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:155
- Comments:8
Top Results From Across the Web
Use Interface Props in Functional Components ... - Pluralsight
This guide described how to use the TypeScript interface to define strongly typed props in a function component. They help define the contract ......
Read more >How to Overload TypeScript React Component Interfaces by ...
This article explains how to create correct, intuitive APIs for React components in TypeScript by using prop values to overload React component interfaces....
Read more >React -TypeScript — How to add interface with functional ...
In this article, I'm going to discuss how to add interface with functional component typed props beginner guide :) Typescript, PropType , React...
Read more >How to Build a React Component with TypeScript Interfaces
This illustrates the power of using TypeScript with tools such as React since they can help guide the development process and document the...
Read more >Best Practices for Using TypeScript and React - OneSignal
TypeScript and React are excellent in combination for apps. Sprinkle in React's expressive component model with strong typing, and you get ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Coming here from storybook migration guide to 6.0. https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x
This is how we define our components so will wait on this to be resolved, rather than re-writing all our components.
Unfortunately I’m not able to help with a fix for the issue.
Thanks in advance to whoever does 😃
I hope it might help as temporary workaround - I made a custom handler for parsing React.FC < Props >, which points at existing Props at UI-component.