Ray Kholodovsky - bit of an edge case. but can ...

bit of an edge case. but can lead to tricky situations... if you have a .tsx file that exports multiple valid things and then you open that up in localhost, it'll just render the first one (I'm pretty sure) and not acknowledge the rest. - it's totally valid to export multiple functions/ components in 1 file. - it might get a little weird if the user expects that file to have a generated output though (can you warn on this?) - the original use case was how a file contained multiple examples, and in order to look at them I have to comment them all out and uncomment one at a time.
Perhaps a "view multiple" feaure in the future, ie: a dropdown in the viewers that let you pick which thing to preview?
No description
2 Replies
Ray Kholodovsky
Ray KholodovskyOP•2mo ago
ooh I found a quick way to handle this by using export default 🙂
No description
Ray Kholodovsky
Ray KholodovskyOP•2mo ago
I still think it would be cool if you could have a little debug feature where, perhaps to the right of the main file selector dropdown, you could render any other export or function or const or whatever that was in the file that was selected. I can see that getting complicated and confusing quickly though

Did you find this page helpful?