aBloomer aBloomer - 1 month ago 8
Javascript Question

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?

Answer

This should work:

import {ACTION_TYPES} from '../actions'