skip to Main Content

enter image description herei am getting red code highlight in vs code even correct syntx and code is also working .. i try to solve this by changing themes & turn off all extantion but nothing fix .and its very annoying to work with that. please help me

i am trying to work with react app in vs code ..but it showing highlighted red color when i use html tag with multiple child in return statement .same with curly braces in return statement

2

Answers


  1. Chosen as BEST ANSWER

    in my case i am able to fix it by re-installing vs-code and then disable all extantion , restart then you can enable extantion again


  2. You should import React at the top like this

       import React from 'react';
    

    I think this solve the problem

    if this not solve your problem then I suggest to uninstall vs code download latest version and then install extensions like ESLint, ES7+ React/Redux/React-Native snippets or try with out any extension and also if you have react install globally in your machine uninstall it and then install react again

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search