Skip to content

Flow does not infer function return type when React Native is required #379

@volkanunsal

Description

@volkanunsal

I'm having a strange issue. In the first case, when React Native is not required, the type inference for getMove() is working, but the compiler doesn't properly infer the type of imported styles.

// var React = require('react-native');
var {
  cellX, cellO
} = require('../styles');
var PlayerStore = createStore({
  getMove(): Array<Array<number>>{
    return "1"
  }
string
This type is incompatible with
  array type

object pattern
Property not found in
  styles.js: exports

And when I uncomment the require for React Native, it doesn't infer the return type of getMove() at all. It looks like there is nothing wrong with the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions