Here are two examples of using a non-default export. The first uses commonjs syntax, and the second uses es6. Why does the first example work, but not the second?
// commonjs --- works!
var ReactRouter = require('react-router')
var Link = ReactRouter.Link
// es6 --- doesn't work!
import ReactRouter from 'react-router'
var Link = ReactRouter.Link
I understand that I can use import { Link } from 'react-router'
instead, but I'm just trying to wrap my head around how each import differs.
var Link = ReactRouter.Link
?