cooperka / react-native-snackbar

:candy: Material Design "Snackbar" component for Android and iOS.
Other
815 stars 150 forks source link

AndroidX support for RN 0.60.0 #114

Closed mehranabi closed 5 years ago

mehranabi commented 5 years ago

Hello @cooperka , Thanks for this library! As you may know, in new version of React Native (0.60.0), support libraries are removed and now you have to use AndroidX. I tried to change imports and replace old support libs with androidx/google-material libs (you can find my fork at https://github.com/mehranabi/react-native-snackbar), but after it, i got another error:

error: bundling failed:
Error: While trying to resolve module `react-native-snackbar` from file `D:\Mehran\Projects\Ostadyar\Ostadyar\src\screens\auth\LoginScreen.js`,
the package `D:\Mehran\Projects\Ostadyar\Ostadyar\node_modules\react-native-snackbar\package.json` was successfully found.
However, this package itself specifies a `main` module field that could not be resolved (`D:\Mehran\Projects\Ostadyar\Ostadyar\node_modules\react-native-snackbar\lib\index.js`. Indeed, none of these files exist:
* `D:\Mehran\Projects\Ostadyar\Ostadyar\node_modules\react-native-snackbar\lib\index.js(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
  * `D:\Mehran\Projects\Ostadyar\Ostadyar\node_modules\react-native-snackbar\lib\index.js\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`

Can you please help me fix this...

mehranabi commented 5 years ago

It's working now! But if you want to publish it, check my change in package.json first!

cooperka commented 5 years ago

Thank you @mehranabi! It looks like there's an existing PR to do this as well, let me know if it works for you: https://github.com/cooperka/react-native-snackbar/pull/112