When should I use brackets with imports

前端 未结 2 483
鱼传尺愫
鱼传尺愫 2020-11-27 08:12

I have two file, the first one is todoHelper.js

it has export const addTodo = (list, item) => [...list, item]

later on I want to use ad

2条回答
  •  攒了一身酷
    2020-11-27 08:31

    Using default keyword with export gives us the liberty to import with alias name

    export default k // in file my.js
    

    can be imported with alias name 'b'

    import b from 'my.js'
    

提交回复
热议问题