GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.
https://nativebase.io/
MIT License
20.2k stars 2.39k forks source link

Nativebase not supported with Next JS and React Native CLI built with Nx Monorepo #5561

Open balramsinghsapient opened 1 year ago

balramsinghsapient commented 1 year ago

Description

Nativebase with React Native CLI and Next JS built with Nx monorepo breaks in installation

CodeSandbox/Snack link

https://notavailable.com

Steps to reproduce

My project is built with Nx monorepo where we want to use Nativebase for Next JS project and React Native CLI project.

Not enough Nativebase documentation for NextJS with Nx. Nx and Nativebase work by decorating next.config.js but break when bound together.

Not enough Nativebase documentation for NextJS and RN CLI combination. Installing Nativebase without expo requires a webpack loader to load the Image from React Native.

I also tried setting up React Native CLI with https://docs.nativebase.io/next-adapter but it is also breaking in reading Image of React Native.

NativeBase Version

3.4.21

Platform

Other Platform

React Native CLI

Additional Information

No response

surajahmed commented 1 year ago

@balramsinghsapient Thanks for reporting! We'll look into this.

Kawaljeet-AUI commented 1 year ago

@surajahmed Any update here?

Kawaljeet-AUI commented 1 year ago

@balramsinghsapient @surajahmed In my case, Nx was the culprit. Somehow it did not allow auto linking to work properly. I had to manually edit the package.json file inside of apps/<your-app> folder. Copy pasting this inside package.json worked for me:

    "@react-navigation/native": "*",
    "@react-navigation/native-stack": "*",
    "react-native-screens": "*",
    "react-native-safe-area-context": "*",
    "native-base": "*"

Hope it helps! Cheers.