I am switching over to ES6, and I have that concern right now.
var RouteHandler = require('react-router').RouteHandler;
I did import RouteHandler from 'react-router'.RouteHandler
, and webpack is giving me an error.
So, how should I import it ?
I am switching over to ES6, and I have that concern right now.
var RouteHandler = require('react-router').RouteHandler;
I did import RouteHandler from 'react-router'.RouteHandler
, and webpack is giving me an error.
So, how should I import it ?
Try import {RouteHandler} from 'react-router'
Alternatively, you could have done:
import * as reactRouter from 'react-router';
var RouteHandler = reactRouter.RouteHandler;