React Native version:
v0.61.0-rc.0
Steps To Reproduce
npx react-native init --version 0.61.0-rc.0
- or
react-native upgrade
Describe what you expected to happen:
Flow should see assets as images, but see strings. This is caused by wrong module name mapper config.
Snack, code example, screenshot, or link to a repository:
Code in template/_flowconfig:
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/\1'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
The fix is: <PROJECT_ROOT> -> <PROJECT_ROOT>/node_modules/react-native.
I'd send the fix myself, but I'm short on time now, just wanted to make sure it's noticed.
React Native version:
v0.61.0-rc.0
Steps To Reproduce
npx react-native init --version 0.61.0-rc.0react-native upgradeDescribe what you expected to happen:
Flow should see assets as images, but see strings. This is caused by wrong module name mapper config.
Snack, code example, screenshot, or link to a repository:
Code in
template/_flowconfig:The fix is:
<PROJECT_ROOT>-><PROJECT_ROOT>/node_modules/react-native.I'd send the fix myself, but I'm short on time now, just wanted to make sure it's noticed.