You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using React.FC to specify the component type, the documentation will not be generated.
Here is minimal repro of a component:
export interface AppProps {
/**
* A string paramter.
*/
param1: string
/**
* A number parameter.
*/
param2: number
}
/**
* This is a component.
*/
const App: React.FC<AppProps> = ({ param1, param2 }) => {
return (
<div>
<div>Param 1: {param1}</div>
<div>Param 2: {param2}</div>
</div>
)
}
export default App
If I use the above snippet and substitute the declaration using the following, it works properly
const App = ({ param1, param2 }: AppProps) => {
This used to work in the earlier betas (Beta 33 I think?), but stopped working at some point after that. When I get a chance, I'll try to find the earliest version in which this started occurring.
Similar to #21801. React.forwardRef also breaks ArgTypes type inference.
The type inference works once I remove React.FC, and the control becomes radio buttons for union types. But if the union type includes both null and undefined, the control would remain text controls.
Describe the bug
When using
React.FC
to specify the component type, the documentation will not be generated.Here is minimal repro of a component:
If I use the above snippet and substitute the declaration using the following, it works properly
This used to work in the earlier betas (Beta 33 I think?), but stopped working at some point after that. When I get a chance, I'll try to find the earliest version in which this started occurring.
To Reproduce
https://github.com/kyletsang/storybook-ts-docs-repro
System
Environment Info: System: OS: macOS 13.2.1 CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz Binaries: Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 8.19.4 Browsers: Chrome: 111.0.5563.146 Edge: 111.0.1661.62 Firefox: 109.0.1 Safari: 16.3
Additional context
No response
The text was updated successfully, but these errors were encountered: