Reputation: 17374
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.
Upvotes: 1
Views: 191
Reputation: 19012
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
Upvotes: 4