Open 0x00000001A opened 9 months ago
As a workaround you can set the docs.source.type
story parameter to 'code'
and specify the source by hand yourself:
const UpInputNumberStories: Meta<UpInputNumberProps> = {
title: 'Inputs/UpInputNumber',
component: UpInputNumber,
tags: ['autodocs'],
parameters: {
docs: {
source: {
type: 'code',
code: `any string you want here`
}
}
}
}
Describe the bug
If component has inline functions in property (like
prop={ () => console.log('ok') }
it will be replaced with() => {}
function. I did't expect that. Is there is any setting to change this behaviour?Given story
Produces the following source code in docs:
To Reproduce
Check the
Button
component story.https://stackblitz.com/edit/github-tu5l3f?file=src%2Fstories%2FButton.stories.tsx%3AL27&preset=node
System
Additional context
If I change the story code to this:
The problem stays. I've tried both
@latest
and@next
storybook versions, triedvite
andwebpack
.And even if I add the following config:
Then code looks strange: