module

Estimated reading time: 1 minute

module

module two elements

  • export
  • import

export

single default export

export default class User{
  .........
}

multiple export

export add = () = {...}
export minus = () = {...}
 add = () = {...}
 minus = () = {...}
 export {add, minus};

import

all

import * from './react';

default import

import component from './react'

alias / rename

import component as comp from './react'

Named import

import {btn,badge} from './react'

only load

import './react'

sourec

es, es6, js