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

add tsx support for <Canvas /> #15190

Closed
jantimon opened this issue Jun 10, 2021 · 1 comment
Closed

add tsx support for <Canvas /> #15190

jantimon opened this issue Jun 10, 2021 · 1 comment

Comments

@jantimon
Copy link

Canvas supports mdxSource but does not allow to set a language and always fallsback to jsx.
Therefore it is not possible to set it to tsx.

Describe the solution you'd like
Right now Canvas has only the mdxSource prop:

mdxSource?: string;

This value is handed over to getSourceProps without specifying a language:

withSource: getSourceProps({ code: decodeURI(mdxSource) }, docsContext, sourceContext),

getSourceProps will use jsx as default:

language: props.language || docsLanguage || 'jsx',

It would be cool if mdxSource would be an object and allows passing over SourceProps or if we could add an optional mdxSourceLanguage property

Are you able to assist to bring the feature to reality?
yes

@shilman
Copy link
Member

shilman commented Jun 15, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if this is still relevant in SB 7.x.

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2023
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