skip to Main Content

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.

2

Answers


    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

    Login or Signup to reply.
  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’;

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search