简体   繁体   English

为什么Flow不理解`export default`

[英]Why flow doesn't understand `export default`

Two instances of code: 两个代码实例:

const obj = {}
export default obj


export default obj = {}

Flow gives an error on the second 在第二个错误

Cannot resolve name obj 无法解析名称obj

Is there something wrong with the code in second place? 第二位的代码有问题吗? It works just fine, but flow warns me. 它工作正常,但流程警告我。

const obj = {
    // property goes here
}
export default obj

or, 要么,

export default {
   // property goes here
 }

or 要么

let obj;
export default obj =  {
  // property goes here
}

Ref: https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export 参考: https : //developer.mozilla.org/zh-CN/docs/web/javascript/reference/statements/export

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM