javascriptecmascript-6es6-modules

How to switch this syntax to ES6?


var ACTION_TYPES = require('../actions').ACTION_TYPES;

I tried to import {ACTION_TYPES.ACTION_TYPES} from ('../actions') but it doesn't seem to work.

How to switch to ES6 using import?


Solution

  • This should work:

    import {ACTION_TYPES} from '../actions'