简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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