Correct way to import lodash

后端 未结 5 1188
梦谈多话
梦谈多话 2020-12-04 07:10

I had a pull request feedback below, just wondering which way is the correct way to import lodash?

You\'d better do import has from \'lodash/has\'.. F

5条回答
  •  时光说笑
    2020-12-04 07:32

    import has from 'lodash/has'; is better because lodash holds all it's functions in a single file, so rather than import the whole 'lodash' library at 100k, it's better to just import lodash's has function which is maybe 2k.

提交回复
热议问题