Skip to content
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

Using backticks for default value in source file will get rendered wrong #19113

Open
Leravig opened this issue Sep 5, 2022 · 5 comments
Open

Comments

@Leravig
Copy link

Leravig commented Sep 5, 2022

If using backticks for default values in the source file they will get rendered with backticks and double quotes instead of just one of them.

With backticks
image

With double quotes
image

Component file for minimal reproduction (React 17)

import { Alert as MuiAlert} from '@mui/material'
import {ComponentProps, VoidFunctionComponent} from 'react'

export const Infobox : VoidFunctionComponent<
	 {
		children?: ComponentProps<typeof MuiAlert>[`children`]
		severity?: ComponentProps<typeof MuiAlert>[`severity`]
	}
> = ({
	// eslint-disable-next-line quotes
	severity = `info`,
	...props
}) => (
	<MuiAlert
		{...props}
		severity={severity}
	/>
)
@ndelangen
Copy link
Member

@Leravig can you check if this problem still exists on the latest 7.0 beta? 🙏

@Leravig
Copy link
Author

Leravig commented Jan 26, 2023

@ndelangen I will give it a try the next days / weeks

@Leravig
Copy link
Author

Leravig commented Apr 21, 2023

@ndelangen sorry for the delay. I tested it today with storybook v7.0.6 and it is still there
Changes: I am using react 18.2.0

@ndelangen
Copy link
Member

I see, that's unfortunate, can you supply a reproduction repository?

@Leravig
Copy link
Author

Leravig commented May 9, 2023

@ndelangen here is the repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants