unsplash / unsplash-js

🤖 Official JavaScript wrapper for the Unsplash API
https://www.npmjs.com/package/unsplash-js
MIT License
2.15k stars 157 forks source link

Why the versions above 6.0.0 doesn't support React Native anymore? #170

Closed Garamani closed 3 years ago

Garamani commented 3 years ago

I upgraded the unsplash-js and found this error: Error: Unable to resolve module unsplash-js/native It seems after version 6.0.0 there is no native.js file. Would you please elaborate on why you are not supporting react-native anymore? Is there any alternative way to use unsplash API in react-native?

OliverJAsh commented 3 years ago

Have you tried importing from unsplash-js (i.e. removing /native)?

Unfortunately I have no experience with React Native so I don't know what changes would be required to make it work. If there was support in the previous version, this was added by someone who is no longer part of our team. We probably removed support in the new version because our primary target audience is browser/Node, not React Native.

If you're able to provide some guidance on what changes would be required to make this work, that would be most helpful. I can't promise we'll be able to spend any time on it though.

Garamani commented 3 years ago

Thank you Oliver for your quick response. I just checked and by removing /native I get the following error:

TypeError: undefined is not a constructor (evaluating 'new _unsplashJs.default({ accessKey: '...' })')

I will investigate later what's the cause of the error.

keung7251 commented 3 years ago

I can not use also It show Error: not implemented