score:3
ok, i have seemed to solve my own issue here. first i needed to edit my .babelrc file to
{
"presets": [
["es2016"],
"react"
],
"plugins": [
"babel-plugin-transform-class-properties"
]
}
obviously installing the babel-plugin-transform-class-properties plugin and babel-preset-es2016, then things seem to compile and work more like i expected.
score:3
arrow functions that are members of a class are not included yet. you need to install babel-transform-class-properties.
run this command:
npm install --save-dev babel-plugin-transform-class-properties
and create a .babelrc
file in the root directory of your project if doesn't exist an add this
{
"plugins": ["transform-class-properties"]
}
or if you need to add some options
{
"plugins": [
["transform-class-properties", { "spec": true }]
]
}
Source: stackoverflow.com
Related Query
- Compiling ES6 React code using laravel-mix
- I receive error 404 on refreshing browser using React router in Laravel Mix
- How to use extract and code splitting in Laravel Mix for React
- What's the difference between "super()" and "super(props)" in React when using es6 classes?
- How to import and export components using React + ES6 + webpack?
- Using mixins vs components for code reuse in Facebook React
- React passing parameter via onclick event using ES6 syntax
- I'm getting error using laravel and react "Invalid DOM property `for`. Did you mean `htmlFor`"
- how to create common helper class in React JS using ES6 which is used by another component?
- componentDidMount method not triggered when using inherited ES6 react class
- How to get country code and Country name using IP in react js
- Why Code Coverage in react app is empty? Tried using npm run test -- --coverage. But always showing empty code coverage
- fetch method is not defined using ES6 fetch in React
- Using ES6 Map with React and/or Redux
- Can react js web code be used for building mobile apps using react native?
- create timer with react native using es6
- Using Jquery and Bootstrap with Es6 Import for React App
- How to unit test React JSX ES6 code with KARMA?
- Using create react app, and having ES6 dependencies
- How to transpile React ES6 classes using Grunt + Browserify + Reactify?
- Is there a method to reset a react component using ES6 classes to its initial state?
- Using express and es6 to render react and jsx server side
- Does using React Hooks drastically reduce how code can be reused in React / Redux?
- Using module.exports in React ES6
- React js - Laravel 5: Using csrf-token in POST method
- how to write inline js event handler code in the react component using "this"
- How do I check if user is 'logged in' in a react component when using laravel authentication?
- SCSS files not compiling to CSS in react using Webpack
- Authenticating Pusher using React Native and a Laravel Backend
- Using Async/Await in ES6 React .JS
More Query from same tag
- Bug in custom hook for fetching local json
- How can I render user's input (which is stored in an array) with LINE BREAKS using react.js?
- Prettier doesn't format .tsx file
- else statement is ignored in react
- How Do I Output Boolean Variables to Screen in ReactJS Typescript?
- How to fetch an API response in React?
- react + firebase loading data issues
- How to make an icon spin in React
- Can Redux cause the React warning "Cannot update a component while rendering a different component"
- Submitting via button click from different component
- How to use images in css with Webpack
- How to display an input box on selection of options value?
- Wait for state to update when using hooks
- react render not working with getElementById
- How to use a typed selector inside of a nested function within a React Functional Component?
- ReactJS: How to update a boolean field in an API using a POST request
- Extra await in react breaks async tests
- "Error: Invalid hook call." when importing React component from shared component library in monorepo (turborepo & npm workspaces)
- How to change the property of each mapped value so that my component can be used more dynamically for each event?
- Module not found: Can't resolve '@material-ui/core/Avatar' in 'D:\own_files\ReactTutorial\react-app\src'
- Why does my NextJS Code run multiple times, and how can this be avoided?
- How to create boundary in React?
- Get react state with dynamic key
- How do I select value and options (label names) are invisible from react-select dropdown?
- Set height of ckeditor using surveyjs-widgets and survey-react
- Upgrade to material ui icons v5 broke react-select
- How to focus the next input with React
- Add button to each row in react-bootstrap-table next
- Replacing custom html tags in react
- What the notched property is supposed to do in Material-UI