aBloomer aBloomer - 1 year ago 159
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 Source

This should work:

import {ACTION_TYPES} from '../actions'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download