Search code examples
javascriptreactjsreduxvisual-studio-2017

Visual Studio not recognizing React/Redux syntax


I just set up the default React/Redux application using visual Studio 2017 (File --> New Project -> ASP.NET core Web Application -> React/Redux. I made no edits to the created project. It runs on IIS Express fine, but when I go and look at the code, there's a bunch of red lines. It doesn't seem to recognize React/Redux syntaxs, as shown in the images below.

I looked around but couldn't find any packages or solutions to this problem. It makes it very hard to debug my code. Does anyone know of a fix? I don't want to use VS Code because it doesn't have resharper.

Not recognizing react/html syntax

Not recognizing reducer syntax in redux

Edit: still not working. All node.js development packages are already installed.


Solution

  • Rename your .js files as .jsx files to fix this issue.