mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.63k stars 131 forks source link

[BUG] Cannot rename sandpack snippetFileName #425

Closed kennarddh closed 3 months ago

kennarddh commented 3 months ago

If you want to ask for support or request features, sponsor the project and contact me over email.

Describe the bug A clear and concise description of what the bug is.

Cannot change snippetFileName in SandpackPreset to value other than /App.js

This bug only happen if snippetFileName is not /App.js

Reproduction Start from https://codesandbox.io/p/sandbox/mdx-editor-base-q8s7zr?file=/src/App.tsx to reproduce the problem so that I can observe the issue on my side and make sure that the fix reliably addresses it.

https://codesandbox.io/p/sandbox/mdx-editor-base-forked-g3wymh?file=/src/App.tsx

To Reproduce Steps to reproduce the behavior:

  1. Create sandpack component
  2. See it has 2 files. one with the name in the config and App.js. The default one is the only one that is editable.

Expected behavior A clear and concise description of what you expected to happen. It should only has 1 file as the config and it should be editable.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

petyosi commented 3 months ago

I think this might be related to sandpack and its templates, can you make this work with sandpack itself outside of the MDXEditor?

petyosi commented 3 months ago

@kennarddh did you figure this out?

kennarddh commented 3 months ago

no, not yet.