Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Visual Studio 2012, I get warnings and squiggly lines when trying to write JSX with React JS

I am using a separate javascript file to put my React JS JSX in. When I use the example given by the documents, I get tons of Visual Studio warnings and ugly squiggly lines..

I cannot figure out a way around this.. Pretty much a deal breaker for React JS.

enter image description here

like image 385
Brandon Tull Avatar asked Nov 03 '14 20:11

Brandon Tull


People also ask

What is ${} in JSX?

You use ${} in string templates like const k = `my name is ${name}` you use {} whenever you want to put some Java code in your JSX code like <div attr={name}>{name}</div>

How do I enable Emmet in JSX?

Go to settings > extensions > emmet > include languages and add javascript as the item and javascriptreact as the value.

Should you use JSX extension?

It is called JSX, and it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript. JSX produces React “elements”.


1 Answers

Visual Studio 2012 was released before ReactJs, so you can't really blame them for not supporting it.

There is some visual studio stuff here:

http://reactjs.net/

You can see support for tooling being asked here:

https://github.com/reactjs/React.NET/issues/3

with Web Essentials being one of the prime picks for asking for support (might want to add your votes!)

If you are using Resharper it might be added in the next release, JetBrains is looking to add it into WebStorm

https://youtrack.jetbrains.com/issue/WEB-10136

like image 192
John Avatar answered Oct 27 '22 11:10

John