react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

Incompatible with `react-native-safe-area-context` version < 4

Open julian-hecker opened this issue 2 years ago • 2 comments

Issue Description

Crashes on web when react-native-safe-area-context version < 4.

Throws error Uncaught Error: No safe area value available. Make sure you are rendering <SafeAreaProvider> at the top of your app.

image

Works fine when react-native-safe-area-context version is >= 4.

Steps to Reproduce / Code Snippets

  1. Initialize a new Expo app with the CLI
  2. Install react-native-safe-area-context@3
  3. Copy the demo into the app
  4. Run on web and see the error

Expected Results

I would expect the app not to crash, or at least a message saying to update react-native-safe-area-context.

Additional Information

  • Nodejs version: 16.51.1
  • React version: 17.0.2
  • React Native version: 0.68.2
  • react-native-gifted-chat version: ^1.0.4
  • Platform(s) (iOS, Android, or both?): Web
  • TypeScript version: ~4.3.5
  • react-native-safe-area-context version: 3.3.2 (Expo SDK 44 Default)

julian-hecker avatar Jul 28 '22 17:07 julian-hecker

Got issue about SafeArea also but

Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider

l2aelba avatar Aug 02 '22 07:08 l2aelba

Fixed by the answer: https://stackoverflow.com/questions/72469920/invariant-violation-tried-to-register-two-views-with-the-same-name-rncsafeareap/72470161#72470161

installed [email protected] before installing a new version of "react-native-safe-area-context" you should check what version in "react-native-gifted-chat": npm list react-native-safe-area-context and get version from image

parnekov avatar Aug 11 '22 08:08 parnekov

as we are using yarn there is no dedupe, it is being done automatically, for us the issue was pinning a specific version of [email protected], after changing to ^4.3.4 it worked

mohas avatar Dec 08 '22 23:12 mohas

I was facing the same issue i had to uninstall and install "react-native-safe-area-context": "^4.4.1",

abumubaarak avatar Jan 11 '23 11:01 abumubaarak

facing the same problem

NilsBaumgartner1994 avatar Jan 31 '23 20:01 NilsBaumgartner1994

Should be fixed with https://github.com/FaridSafi/react-native-gifted-chat/pull/2353 and https://github.com/FaridSafi/react-native-gifted-chat/releases/tag/v2.0.0

Johan-dutoit avatar Mar 13 '23 09:03 Johan-dutoit