react-native-linear-gradient: react-native-linear-gradient Required module not found

I’m getting react-native-linear-gradient Required module not found from Flow in my React-Native project. Any ideas why?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I have had this (edit: I mean the flow issue that @naineshg posted with picture, sorry I wasn’t clear) issue before. The problem is that Flow doesn’t recognize files with the extensions .ios.js and .android.js. The solution I use is to add these lines to the .flowconfig file (you can change it according to your needs).

module.file_ext=.ios.js
module.file_ext=.android.js
module.file_ext=.js
module.file_ext=.json

Want to point out this issue also affects eslint, not just Flow. So the .flowconfig change isn’t a complete fix.

Relevant: https://github.com/benmosher/eslint-plugin-import/issues/279

@danielsukmana you missed .jsx extension. Complete list:

module.file_ext=.ios.js
module.file_ext=.android.js
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json

The suggestion by @danielsukmana solved the issue for me. To be clear, these lines should go under the [options] section of your .flowconfig

I have no idea why ReactNative wouldn’t include these lines in their default .flowconfig. It does seem that the issue is a ReactNative one, and not this package. I’d recommend closing this issue unless @naineshg is unable to get fix the issue with the above suggestion.

This breaks eslint and also mocha can’t import this module.

why don’t add a index.js? or change index in package.json?