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

Not working in .tsx? #70

Open
glassesUSA opened this issue Dec 20, 2021 · 4 comments
Open

Not working in .tsx? #70

glassesUSA opened this issue Dec 20, 2021 · 4 comments

Comments

@glassesUSA
Copy link

For some reason I cannot run any of these scripts in a .tsx file...

@glassesUSA
Copy link
Author

Correction - It seems its 'sfc' not working at all

@am1006
Copy link

am1006 commented Jan 1, 2022

See #50 for reasons.

I can confirm that fc snippet works for TSX files.

@scole954387
Copy link

@am1006 I'm new to react, so does this mean that sfc is no longer suppose to be used? The documentation for the extension hasn't been updated and sfc still works in js files but doesn't work in tsx. I'm creating a project and have been using sfc in all js files and just copying the code over to tsx files. Thanks

@am1006
Copy link

am1006 commented Mar 7, 2022

@am1006 I'm new to react, so does this mean that sfc is no longer suppose to be used? The documentation for the extension hasn't been updated and sfc still works in js files but doesn't work in tsx. I'm creating a project and have been using sfc in all js files and just copying the code over to tsx files. Thanks

Hi, I believe so. The concept of "sfc" is now deprecated after the introduction of react hooks. But I think it's fine for you to copy code to typescript files - it's still compatible.

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

No branches or pull requests

3 participants