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
- Add index.js to save everyone fiddling with their eslint and/or flow configs Context: https://github.com/react-native-community/react-native-linear-gradient/issues/110 — committed to designorant/react-native-linear-gradient by designorant 7 years ago
- Add index.js to save everyone fiddling with their eslint and/or flow configs Context: https://github.com/react-native-community/react-native-linear-gradient/issues/110 — committed to designorant/react-native-linear-gradient by designorant 7 years ago
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.jsand.android.js. The solution I use is to add these lines to the.flowconfigfile (you can change it according to your needs).Want to point out this issue also affects
eslint, not just Flow. So the.flowconfigchange isn’t a complete fix.Relevant: https://github.com/benmosher/eslint-plugin-import/issues/279
@danielsukmana you missed .jsx extension. Complete list:
The suggestion by @danielsukmana solved the issue for me. To be clear, these lines should go under the
[options]section of your.flowconfigI 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?