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

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Open kovkev opened this issue 3 years ago • 3 comments

Issue Description

Expo. React-native-web. When I open a GiftedChat, I see this:

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `GiftedChat`.
    at ActionSheetProvider (https://website.com/static/js/bundle.js:342428:23)
    at div
    at https://website.com/static/js/bundle.js:153244:25
    at SafeAreaView (https://website.com/static/js/bundle.js:145874:25)
    at GiftedChat (https://website.com/static/js/bundle.js:344291:81)
    at div
    at https://website.com/static/js/bundle.js:153244:25
    at div
    at https://website.com/static/js/bundle.js:153244:25
    at ProxyFacade (https://website.com/static/js/bundle.js:122955:20)
    at SafeAreaProvider (https://website.com/static/js/bundle.js:145733:23)
    at observerComponent (https://website.com/static/js/bundle.js:70160:80)
    at ChatView (https://website.com/static/js/bundle.js:1060:26)
    at ProxyFacade (https://website.com/static/js/bundle.js:122955:20)
    at RenderErrorBoundary (eval at ES6ProxyComponentFactory (https://website.com/static/js/bundle.js:122460:10), RenderErrorBoundary:14:7)
    at ProxyFacade (https://website.com/static/js/bundle.js:122955:20)
    at ProxyFacade (https://website.com/static/js/bundle.js:122955:20)
    at RouterProvider (https://website.com/static/js/bundle.js:168405:5)
    at div
    at https://website.com/static/js/bundle.js:153244:25
    at ProxyFacade (https://website.com/static/js/bundle.js:122955:20)
    at SafeAreaProvider (https://website.com/static/js/bundle.js:145733:23)
    at App (https://website.com/static/js/bundle.js:1080:81)
    at LanguageApp (https://website.com/static/js/bundle.js:1192:22)
    at LanguageProvider (https://website.com/static/js/bundle.js:1176:34)
    at div
    at https://website.com/static/js/bundle.js:153244:25
    at GestureHandlerRootView
    at AppWrapper
    at ExpoRootComponent (https://website.com/static/js/bundle.js:37617:83)

Steps to Reproduce / Code Snippets

Create an expo project and add react-native-gifted-chat and a <GiftedChat/>. Open a page with GiftedChat in it. The chat renders.

Expected Results

No errors pops up in the console.

Additional Information

  • Nodejs version: 19.0.0
  • React version: 18.0.0
  • React Native version: 0.69.6
  • react-native-gifted-chat version: 1.0.3/1.0.4
  • Platform(s) (iOS, Android, or both?): Web
  • TypeScript version: 4.3.5

kovkev avatar Nov 04 '22 04:11 kovkev

This has been fixed in @expo/react-native-action-sheet 4.0.1.

bradbyte avatar Nov 04 '22 20:11 bradbyte

This is happening to me. Has anyone got a fix.

Gautham495 avatar Sep 17 '24 11:09 Gautham495

+1

abdullatifHH avatar Jul 08 '25 12:07 abdullatifHH