title: Babel Plugin Class Properties – React Arrow Functions
body: <p>I am running a React project using npm. After hours of research and experimenting, everywhere says I have to add the following code to my ".babelrc" file, which I do not have in my directory and cannot create:</p>
  
  <pre><code>{
    "plugins": [
      ["@babel/plugin-proposal-class-properties", { "loose": true }]
    ]
  }
  </code></pre>
  
  <p>But this leads to the following error when I run the code:</p>
  
  <pre><code>ERROR in ./src/components/NavBar/Menu.js
  Module build failed (from ./node_modules/babel-loader/lib/index.js):
  SyntaxError: /Users/ymoondhra/Desktop/yt-web/src/components/NavBar/Menu.js:
  Support for the experimental syntax 'classProperties' isn't currently enabled
   (20:10):
    18 |     }
    19 | 
  &gt; 20 |     fast = () =&gt; {
       |          ^
    21 |         this.speed = 100;
    22 |     }
    23 | 
  Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' 
  section of your Babel config to enable transformation.
  </code></pre>