gpt4 book ai didi

javascript - React : What does following mean: import register, * as fromRegister from './registerReducer' ?

转载 作者:行者123 更新时间:2023-12-02 14:11:07 26 4
gpt4 key购买 nike

以下内容是什么意思:import register, * as fromRegister from './registerReducer'

register 和 * as fromRegister 部分代表什么?

最佳答案

它导入register,因为它是默认导出,然后将所有带有*的内容导入为fromRegister。让我来分解一下:

import register, * as fromRegister from './registerReducer'

它将默认导出的导出register导入到当前作用域中,使用export default ...,然后使用*<导入所有内容 作为 fromRegister,它是来自文件 registerReducer.js 的标签。您可以阅读Mozilla Developer Network了解更多信息.

关于javascript - React : What does following mean: import register, * as fromRegister from './registerReducer' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39563388/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com