Flow occur error about this code

export User, { schema } from './model'

this is 'direct exporting' in ES6.
It's a code without any problems.
But Flow treats this code as an error

Unexpected identifier

   9| export User, { schema } from './model'

1 Answers

loganfsmyth On

this is 'direct exporting' in ES6.

That is not correct.

export User from './model'

is not valid ES6. It can be valid with Babel with certain experimental plugins enabled, however it would appear that Flow does not support that.

The ES6 version of your snippet would be

export { default as User, schema } from './model';