12

Hello people im getting this error in react native In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app I have tried this @react-aria/ssr and used instead of , but not resolved the warning. any suggestions would be helpful.

Im using react 18.2.0, native base ^3.4.28, react native 0.71.8.

below is my code in App.js

<Provider store={store}>
    <NativeBaseProvider theme={theme}>
      <SafeAreaView style={{flex: 1, backgroundColor: '#292929'}}>
        <StatusBar
          translucent
          backgroundColor="#292929"
          barStyle="light-content"
        />
        <AppNavigation />
      </SafeAreaView>
    </NativeBaseProvider>
  </Provider>

I have tried this @react-aria/ssr and used instead of , but not resolved the warning. any suggestions would be helpful.

Harsh Patel
  • 688
  • 2
  • 5
  • 16
avinash akula
  • 121
  • 1
  • 3
  • 3
    I'm having the same issue. I initiated a fresh project, where I only installed nativebase, and I'm coming across the identical problem. – Caner Kuru Jun 29 '23 at 14:17
  • Check this many has this issue https://github.com/GeekyAnts/NativeBase/issues/5758 – Khanakia Jul 04 '23 at 18:39

2 Answers2

9
  1. Navigate to node_modules/native-base/src/core/NativeBaseProvider.tsx
  2. Delete that wraps {children}. Take care not to delete {children}.
  3. Remove SSRProvider import. That is, delete this line import { SSRProvider } from '@react-native-aria/utils';
  4. Run npx patch-package native-base. Select yes in the prompt.

When Native Base officially fixes it, you can delete the patch from the patch directory that was created and reinstall native-base

https://github.com/GeekyAnts/NativeBase/issues/5758

  • I would prefer to not touch third party package code. Changes there might not work in release deploy, when the packages are fetched from original source. Also any changes under node_modules-folder are ignored by git by default. You would need to have a workaround for that too. But in this specific case this won't show up in release version as it is only warning. You can ignore it with the logbox but that is only hiding it. Real fix is to release a fix to the native-base package. – J-ho Aug 22 '23 at 11:42
  • NativeBase was deprecated. They released gluestack framework – Buzzy Aug 31 '23 at 17:09
-1

for me I added this:

 useEffect(() => {
    LogBox.ignoreLogs(['In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.']);
  }, []);

Don't forget to import {LogBox} from 'react-native';

toyota Supra
  • 3,181
  • 4
  • 15
  • 19