VS Code not recognizing JSX syntax in HTML
Answered
Bengal posted this in #help-forum
BengalOP
Even though I selected JavaScript React in the Status Bar, I still keep getting the red squiggly lines. Is it an extension problem or what? The code works, but I'm curious to know this fix.
NOTE: I'm following NEXT.JS's own tutorials on their website: https://nextjs.org/learn/react-foundations/building-ui-with-components
Thanks in advance!
NOTE: I'm following NEXT.JS's own tutorials on their website: https://nextjs.org/learn/react-foundations/building-ui-with-components
Thanks in advance!
Answered by joulev
hmm does it still work if you go to the browser? if it does it should be fine, the editor is probably just dumb and you can just ignore that.
you will also know soon that we typically don't write react in html files so you won't encounter this issue when you use react normally.
you will also know soon that we typically don't write react in html files so you won't encounter this issue when you use react normally.
11 Replies
Blood cockle
does putting () around your h1 do anything?
or putting a ; at the end of your expression after the </h1>?
BengalOP
unfortunately it doesn't
Blood cockle
k. it helps if you give more information, not less. i know it seems relevant to screenshot only the exact squiggle. but posting the whole code lets people check other parts
BengalOP
my bad. apologies.
i'm following line by line based of:
https://nextjs.org/learn/react-foundations/
currently on chapter 6
https://nextjs.org/learn/react-foundations/
currently on chapter 6
@Bengal Even though I selected JavaScript React in the Status Bar, I still keep getting the red squiggly lines. Is it an extension problem or what? The code works, but I'm curious to know this fix.
*NOTE*: I'm following NEXT.JS's own tutorials on their website: https://nextjs.org/learn/react-foundations/building-ui-with-components
Thanks in advance!
hmm does it still work if you go to the browser? if it does it should be fine, the editor is probably just dumb and you can just ignore that.
you will also know soon that we typically don't write react in html files so you won't encounter this issue when you use react normally.
you will also know soon that we typically don't write react in html files so you won't encounter this issue when you use react normally.
Answer
BengalOP
yes it does work in the browser
yeah it's fine to ignore the red lines then
@joulev hmm does it still work if you go to the browser? if it does it should be fine, the editor is probably just dumb and you can just ignore that.
you will also know soon that we typically don't write react in html files so you won't encounter this issue when you use react normally.
BengalOP
ok appreciate the help. got that