Support for the experimental syntax 'classProperties' isn't currently enabled

I added Truncate-react to my project after that, react asked me to install @babel/plugin-proposal-class-properties, which I did in the package.json file in this way

  "babel": {
    "presets": [
      "@babel/preset-env",
      "@babel/preset-react"
    ],
    "plugins": [
      [
        "@babel/plugin-proposal-class-properties",
        {
          "loose": true
        }
      ]
    ]
  }

Of course, he himself proposal-class-properties I installed with the label --save-dev

But after all this, I still get knocked out by an error that looks like this

so

Author: Andrey Freiz, 2020-09-15

1 answers

I had to change import TextTruncate from 'react-text-truncate/src/TextTruncate' to import TextTruncate from 'react-text-truncate' because initially I took an uncompiled file and caught the error

 3
Author: Andrey Freiz, 2020-09-16 11:34:33