<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Honza</title>
    <description>The latest articles on DEV Community by Honza (@gynekolog).</description>
    <link>https://dev.to/gynekolog</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F214248%2F93256de5-f8df-4fed-913d-e1b721d19c33.jpeg</url>
      <title>DEV Community: Honza</title>
      <link>https://dev.to/gynekolog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gynekolog"/>
    <language>en</language>
    <item>
      <title>React 17, JSX Transform &amp; IntelliJ IDE</title>
      <dc:creator>Honza</dc:creator>
      <pubDate>Mon, 23 Nov 2020 15:16:12 +0000</pubDate>
      <link>https://dev.to/gynekolog/react-17-intellij-ide-4nhj</link>
      <guid>https://dev.to/gynekolog/react-17-intellij-ide-4nhj</guid>
      <description>&lt;p&gt;If you're using IntelliJ IDE to developing your react app, you can found a few issues after upgrade React to version 17.&lt;/p&gt;

&lt;p&gt;Typically you followed instruction, enable react-jsx and your IDE scream on you &lt;code&gt;Cannot use JSX unless the '--jsx' flag is provided&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;OK, where's problem?&lt;/p&gt;

&lt;p&gt;React 17 comes with the support of a new version of the JSX transform. More info can be found on the official &lt;a href="https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html"&gt;blog post&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a default, IntelliJ IDE doesn't use a TypeScript version which is located at your project &lt;code&gt;node_modules&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;The latest IDE builds (EAP 2020.3) uses TypeScript v4.0.2 but new JSX Transform require TypeScript v4.1.0 or newer.&lt;/p&gt;

&lt;p&gt;You need to change the bundled TS version to the TS version which is using your app:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Preferences -&amp;gt; Language &amp;amp; Frameworks -&amp;gt; TypeScript -&amp;gt; TypeScript&lt;/code&gt;&lt;br&gt;
(&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/lagjwnj86lowlxair6i3.png"&gt;https://dev-to-uploads.s3.amazonaws.com/i/lagjwnj86lowlxair6i3.png&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Now you can enable JSX Transform at your &lt;code&gt;tsconfig.json&lt;/code&gt; (more info: &lt;a href="https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports"&gt;https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
"jsx": "react-jsx",
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and optimize your imports by &lt;a href="https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports"&gt;official instruction&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank's to the github user &lt;code&gt;codepiyush&lt;/code&gt; for the hint: &lt;a href="https://github.com/facebook/create-react-app/issues/9868#issuecomment-732016066"&gt;https://github.com/facebook/create-react-app/issues/9868#issuecomment-732016066&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>intellij</category>
    </item>
  </channel>
</rss>
