react-native-swiper icon indicating copy to clipboard operation
react-native-swiper copied to clipboard

Attempted import error: 'Swiper' is not exported from 'react-native-swiper'.

Open Makio64 opened this issue 4 years ago • 8 comments

Which OS ?

Web expo

Version

Which versions are you using:

  • react-native-swiper v1.6
  • react-native v0.62

Expected behaviour

No import problem

Actual behaviour

Attempted import error: 'Swiper' is not exported from 'react-native-swiper'.

How to reproduce it>

create new expo project add swiper somewhere

How to fix it>

replace : module.exports = Swiper; module.exports.default = Swiper; by export default Swiper export {Swiper}

Makio64 avatar May 10 '20 23:05 Makio64

try with:

import Swiper from 'react-native-swiper/src';

lennonprado avatar May 20 '20 22:05 lennonprado

same here.

dongdyang avatar May 26 '20 00:05 dongdyang

try with:

import Swiper from 'react-native-swiper/src';

this works, but is a hacky work around as it shows an issue in TypeScript compiler.

daxfrost avatar Sep 01 '20 16:09 daxfrost

I got the same error: Attempted import error: 'react-native-swiper' does not contain a default export (imported as 'Swiper').

ferolo3000 avatar Jan 24 '21 11:01 ferolo3000

It seems that this issue has already been fixed by OP (thank you!)... is there a reason it hasn't been merged?

rajkundu avatar Dec 04 '21 18:12 rajkundu

Please publish the fix...

mvltivitamin avatar Dec 27 '21 23:12 mvltivitamin

try with:

import Swiper from 'react-native-swiper/src';

this works, but is a hacky work around as it shows an issue in TypeScript compiler.

For now you could also just add this to one of your .d.ts files:

declare module 'react-native-swiper/src' {
  import Swiper from 'react-native-swiper'
  export default Swiper
}

joaocdvr avatar Aug 25 '22 14:08 joaocdvr

try with: import Swiper from 'react-native-swiper/src';

this works, but is a hacky work around as it shows an issue in TypeScript compiler.

For now you could also just add this to one of your .d.ts files:

declare module 'react-native-swiper/src' {
  import Swiper from 'react-native-swiper'
  export default Swiper
}

That's great! I'm glad to see that this actually works!

natainditama avatar Jun 19 '23 06:06 natainditama