minhtranite / react-notifications

Notification component for ReactJS
https://www.npmjs.com/package/react-notifications
287 stars 65 forks source link

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

Closed berge-business closed 3 years ago

berge-business commented 3 years ago

Getting this error when trying compile app:

./node_modules/react-notifications/src/NotificationContainer.js SyntaxError: /Users/upwork/Documents/Aerotage/Application/aero_web_app_react/node_modules/react-notifications/src/NotificationContainer.js: Support for the experimental syntax 'classProperties' isn't currently enabled (7:20):

5 | 6 | class NotificationContainer extends React.Component {

7 | static propTypes = { | ^ 8 | enterTimeout: PropTypes.number, 9 | leaveTimeout: PropTypes.number 10 | };

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.

Might need to add to babel file:

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

berge-business commented 3 years ago

Apologies, I figured out what was wrong. IDE imported NotificationContainer as so: import {NotificationContainer} from "react-notifications/src" Had to be imported from just "react-notifications"