Closed pashute closed 5 years ago
Right, having two variables named connect
shouldn't work. Regardless of that, can you give some more context - eslint version & setup?
Haven't tried it locally, but what might work is something like the following (renaming the property you destructure from the Kontakt object):
import { connect } from 'react-redux';
import Kontakt from 'react-native-kontaktio';
const { connect: connectKontakt, configure /* ... all the other things you need from RNKontakt */ } = Kontakt;
Thank you!!
Meanwhile I changed the other (redux) constant by calling
import { connect as reduxConnect } from 'react-redux';
and that worked. But had to change my redux code a tiny bit.
I have
And then:
But I get an ESLint error: connect is already defined. And rightly so, no?
I tried
But that gives me: Possible Unhandled Promise Rejection (reactNativeKontaktio.connect) is not a function.
What should/can I do?
Please see https://stackoverflow.com/questions/51589676/es6-how-to-import-already-defined-in-another-js-package