score:7

Accepted answer

The fix to include React.Fragment in the definition is included in this commit: https://github.com/facebook/flow/commit/b76ad725177284681d483247e89739c292ed982b

It should be available in flow 0.71

score:1

As simple as:

import * as React from 'react'

const Component = (): React.Element<typeof React.Fragment> => (
  <>
    <span> / </span>
    <span> \ </span>
  </>
)

export default Component

score:6

You have to use import * as React from 'react' to fix this :)


Related Query

More Query from same tag