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.16k stars 2.39k forks source link

In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app #5758

Open chensuhuan opened 1 year ago

chensuhuan commented 1 year ago

Description

In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app

CodeSandbox/Snack link

1

Steps to reproduce

WARN In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app. at $29383e587d62412a$export$9f8ac96af4b1b2ae

Expo Version: "expo": "~48.0.18",

NativeBase Version

3.4.28

Platform

Other Platform

No response

Additional Information

WARN In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app. at $29383e587d62412a$export$9f8ac96af4b1b2ae

Expo Version: "expo": "~48.0.18",

darrylyoung commented 1 year ago

I also started seeing the same warning this morning after upgrading to React Native 0.71.11. For context, I'm not using Expo, and I'm using NativeBase 3.4.28.

kurucaner commented 1 year ago

I'm also seeing the same error.

"native-base": "^3.4.28", "react": "18.2.0", "react-native": "0.71.8",

shrikkkk commented 1 year ago

same here in ReactNative 0.71.8 and NativeBase3.4.28

WebVishalOfficial commented 1 year ago

After an update, the node module has the Same Warning occurs where I'm using react 18.2.0, ReactNative 0.71.8 , NativeBase 3.4.28, expo ~48.0.18

AlexanderBabak commented 1 year ago

I have the same issue "native-base": "^3.4.28", "react": "18.2.0", "react-native": "0.71.8",

warleyvods commented 1 year ago

I have the same issue "native-base": "^3.4.28", "react": "18.2.0", "react-native": "0.71.8",

FabianReitz commented 1 year ago

I just bootstrapped a new project with NativeBase with the same problem: "native-base": "^3.4.28", "react": "18.2.0", "react-native": "0.71.8",

piruthuvi22 commented 1 year ago

I also faced the same problem

"native-base": "^3.4.28", "react": "18.2.0", "react-native": "0.71.8",

rubenmaat commented 1 year ago

I have the same problem and I'm working without expo.

"native-base": "^3.4.28", "react": "18.2.0", "react-native": "0.71.8",

nickherious commented 1 year ago

Same issue here

"native-base": "^3.4.28", "react": "18.2.0" "react-native": "0.71.8",

alanluigi commented 1 year ago

+1

danielLutziger commented 1 year ago

+1

SohaibKtb commented 1 year ago

+1

CharlysTorres commented 1 year ago

+1

wasiquehaider commented 1 year ago

+1

filipecalm commented 1 year ago

Idem

joeyboth commented 1 year ago

+1

khanakia commented 1 year ago

+1

eccianime commented 1 year ago

+1

alexukm commented 1 year ago

+1

aldvintumbelaka commented 1 year ago

I have the same problem, even with brand new app and only native base installed

natemartins commented 1 year ago

+1 Incrementing the counter

RSDxavier commented 1 year ago

+1

Chiomsyn commented 1 year ago

Please how can one resolve this issue?

khanakia commented 1 year ago

NativeBaseProvider is using SSRProvider which is not required anymore. So maintainer will have to remove the SSRProvider in order to fix this issue

natemartins commented 1 year ago

NativeBaseProvider is using SSRProvider which is not required anymore. So maintainer will have to remove the SSRProvider in order to fix this issue

@khanakia Can you do this and create a PR for NativeBase to merge?

kurucaner commented 1 year ago

NativeBaseProvider is using SSRProvider which is not required anymore. So maintainer will have to remove the SSRProvider in order to fix this issue

@khanakia Can you do this and create a PR for NativeBase to merge?

I've created a PR for the issue.

PR: https://github.com/GeekyAnts/NativeBase/pull/5764

daniazizz commented 1 year ago

+1

shrikkkk commented 1 year ago

+1

HenriqueMarcelo commented 1 year ago

A working around until the oficial fix:

In your App.tsx or index.js

import { LogBox } from "react-native"

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

natemartins commented 1 year ago

A working around until the oficial fix:

In your App.tsx or index.js

import { LogBox } from "react-native"

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

Instead of ignoring the error, you can resolve it by yourself. Here's how:

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

Voila! Problem solved.

D-Abdi commented 1 year ago

@natemartins Does this not interfere with the build app when deploying it to production?

Joao-Victor-Medeiros commented 1 year ago

@natemartins could you explain the command please, i have an erro at the last step:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/path-package - Not found
npm ERR! 404 
npm ERR! 404  'path-package@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

did you know if i made some mistake ?

amurorayhk commented 1 year ago

+1

truediogo commented 1 year ago

@natemartins could you explain the command please, i have an erro at the last step:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/path-package - Not found
npm ERR! 404 
npm ERR! 404  'path-package@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

did you know if i made some mistake ?

the package name is patch-package not path-package, copy from instructions on https://github.com/GeekyAnts/NativeBase/issues/5758#issuecomment-1624099685

natemartins commented 1 year ago

@natemartins Does this not interfere with the build app when deploying it to production?

It does not. I have production apps of which I have performed series of patches to libraries whose maintainers were not approving PRs

natemartins commented 1 year ago

@natemartins could you explain the command please, i have an erro at the last step:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/path-package - Not found
npm ERR! 404 
npm ERR! 404  'path-package@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

did you know if i made some mistake ?

A little tip: when following instructions that involve entering commands in the terminal, it's best to copy and paste the command

D-Abdi commented 1 year ago

@natemartins Does this not interfere with the build app when deploying it to production?

It does not. I have production apps of which I have performed series of patches to libraries whose maintainers were not approving PRs

Thanks for your reply! But how do you determine if it will not interfere with the build? Because to my knowledge, the libraries in the node_modules are installed again when deploying causing the production version to contain the unedited file with code that causes an error. Is my understanding correct, or is there something i am missing?

natemartins commented 1 year ago

@natemartins Does this not interfere with the build app when deploying it to production?

It does not. I have production apps of which I have performed series of patches to libraries whose maintainers were not approving PRs

Thanks for your reply! But how do you determine if it will not interfere with the build? Because to my knowledge, the libraries in the node_modules are installed again when deploying causing the production version to contain the unedited file with code that causes an error. Is my understanding correct, or is there something i am missing?

As long as you have the patch directory and a postinstall script in your package.json, even when the library is redownloaded, the postinstall script patches the library again.

In your package.json, add "postinstall": "patch-package", to the scripts.

Joao-Victor-Medeiros commented 1 year ago

@natemartins could you explain the command please, i have an erro at the last step:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/path-package - Not found
npm ERR! 404 
npm ERR! 404  'path-package@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

did you know if i made some mistake ?

A little tip: when following instructions that involve entering commands in the terminal, it's best to copy and paste the command

thanks a lot, but for me works without the command, i only reload the project and run on Expo. Work very well excluding SSRProvider

nelsera commented 1 year ago

+1

khanakia commented 1 year ago

But why do we have to go through this patch hacking?

Can't just Nativebase maintainer approve the PR everybody is facing this issue and it is so important to fix it for good.

It's not good to be ignored when you have such an urgent issue to be fixed. I wish I would have never used nativebase but there is no going back.

khanakia commented 1 year ago

A request to the maintainers. @surajahmed @rayan1810 @ankit-tailor Will you be able to check this issue please at the earliest?

natemartins commented 1 year ago

A request to the maintainers. @surajahmed @rayan1810 @ankit-tailor Will you be able to check this issue please at the earliest?

But why do we have to go through this patch hacking?

Can't just Nativebase maintainer approve the PR everybody is facing this issue and it is so important to fix it for good.

It's not good to be ignored when you have such an urgent issue to be fixed. I wish I would have never used nativebase but there is no going back.

You have to know that they have abandoned NativeBase and opted to build a new library, gluestack, while neglecting pertinent pending issues and PRs on this library.

Even the gluestack is buggy.

Does anyone have a better alternative that offers something close or superior to what NativeBase offered?

Samuelplim commented 1 year ago

A working around until the oficial fix: In your App.tsx or index.js import { LogBox } from "react-native" LogBox.ignoreLogs([ 'In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.', ])

Instead of ignoring the error, you can resolve it by yourself. Here's how:

  • Navigate to node_modules/native-base/src/core/NativeBaseProvider.tsx
  • Delete <SSRProvider></SSRProvider> that wraps {children}. Take care not to delete {children}.
  • Remove SSRProvider import. That is, delete this line import { SSRProvider } from '@react-native-aria/utils';
  • 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

Voila! Problem solved.

TK, apaguei o componente e funcionou corretamente.

natemartins commented 1 year ago

A working around until the oficial fix: In your App.tsx or index.js import { LogBox } from "react-native" LogBox.ignoreLogs([ 'In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.', ])

Instead of ignoring the error, you can resolve it by yourself. Here's how:

  • Navigate to node_modules/native-base/src/core/NativeBaseProvider.tsx
  • Delete <SSRProvider></SSRProvider> that wraps {children}. Take care not to delete {children}.
  • Remove SSRProvider import. That is, delete this line import { SSRProvider } from '@react-native-aria/utils';
  • 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 Voila! Problem solved.

TK, apaguei o componente e funcionou corretamente.

@Samuelplim Glad it worked. For future purposes, kindly use the language being used on the thread you want to comment on.

nickherious commented 1 year ago

A working around until the oficial fix: In your App.tsx or index.js import { LogBox } from "react-native" LogBox.ignoreLogs([ 'In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.', ])

Instead of ignoring the error, you can resolve it by yourself. Here's how:

  • Navigate to node_modules/native-base/src/core/NativeBaseProvider.tsx
  • Delete <SSRProvider></SSRProvider> that wraps {children}. Take care not to delete {children}.
  • Remove SSRProvider import. That is, delete this line import { SSRProvider } from '@react-native-aria/utils';
  • 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 Voila! Problem solved.

TK, apaguei o componente e funcionou corretamente.

@Samuelplim Glad it worked. For future purposes, kindly use the language being used on the thread you want to comment on.

Wow this works, no more errors and I learned something new, never knew you could patch packages. Thank you!

aluno77 commented 1 year ago

In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app. . HELP React native, NativeBase

ildaneta commented 1 year ago

I'm also with this terrible alert, and even making those steps, after a time, return again the warning.

Expo sdk 48

SupriyaPKalghatgi commented 1 year ago

I'm also with this terrible alert, and even making those steps, after a time, return again the warning.

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

Expo sdk 48

Same here