I'm trying to add a background image from react native BackgroundImage which needs to add source as source={require('*--iamge path --*')}
but my eslint throw Require statement not part of import statement. error. i have tried to import image in different ways for example:
- const image = '--image path--' - import image = require('--image path--') - <BackgroundImage source={require('--image path--')}>
you can disable this check in eslintrc.js
file
module.exports = { ... rules: { ... '@typescript-eslint/no-var-requires': 0, } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With