Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In React 18 SSRProvider is not necessary and is a noop. You can remove it from your app, how to resolve this warning?

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.

like image 756
avinash akula Avatar asked Nov 17 '25 08:11

avinash akula


1 Answers

  1. Navigate to node_modules/native-base/src/core/NativeBaseProvider.tsx.
  2. Delete the <SSRProvider></SSRProvider> that wraps {children}. Take care not to delete {children}.
  3. Remove the 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.
  5. Add this line to your package.json file. This way, every time you run npm install, the patch will be applied.
"scripts": {
  "postinstall": "npx patch-package"
}

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

like image 126
Gustavo Rezin Avatar answered Nov 19 '25 10:11

Gustavo Rezin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!