SimformSolutionsPvtLtd/react-native-story-view

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

Closed this issue · 10 comments

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

any solution now? I got this error when using multistorycontainer

@fukemy Which react-native-reanimated version are you using in project ?

here is my package.json:

    "react-native-reanimated": "^2.9.0",
    "react-native-gesture-handler": "^2.5.0",

@fukemy Can you upgrade reanimated version to 2.10.0 and let us know after ?
Probable reason for this waring is in Animated.Flatlist we can not pass ref in earlier version.

This issue was fixed in reanimated 2.10.0.
Changelog of react-native-reniamted 2.9.0 to 2.10.0
software-mansion/react-native-reanimated@970576f

Hi, thanks for your suggest, i tried version 2.10.0 and the problem disappear, but I have another question, can I post here?

I have customview like this:

renderCustomView={() => (
                <Pressable onPress={() => {
                  alert('btn clicked')
                }} style={{
                    position: 'absolute',
                    backgroundColor: 'green',
                    top: 46,
                    right: 55,
                  }}>
                  <FontAwesome5Icon name='heart' size={20} color='white'/>
                </Pressable>
              )}

But I can not click, I dont know why, only close button clickable, please see the image below:

Screen Shot 2023-01-06 at 11 19 45

@fukemy Can you please create separate issue for these ? We'll look into this.

@fukemy Can you upgrade reanimated version to 2.10.0 and let us know after ? Probable reason for this waring is in Animated.Flatlist we can not pass ref in earlier version.

This issue was fixed in reanimated 2.10.0. Changelog of react-native-reniamted 2.9.0 to 2.10.0 software-mansion/react-native-reanimated@970576f

@karimApps142 Please follow the same. This should resolve your issue.

ok bro, I will create issue request

@fukemy Thanks, We will close this issue as it is resolved.