IjzerenHein / react-navigation-shared-element

React Navigation bindings for react-native-shared-element 💫
https://github.com/IjzerenHein/react-native-shared-element
MIT License
1.27k stars 124 forks source link

TypeError: undefined is not an object (evaluating 'getPrototypeOf(sourceComponent)') #234

Open LuuNguyen0811 opened 2 years ago

LuuNguyen0811 commented 2 years ago

TypeError: undefined is not an object (evaluating 'getPrototypeOf(sourceComponent)')

I get these errors when i use a render callback for the screen instead of specifying a component prop with createSharedElementStackNavigator. But when I use createStackNavigator it works.

How to fix it. Thanks

<Stack.Screen name="Home">
  {props => <HomeScreen {...props} extraData={someData} />}
</Stack.Screen>

Simulator Screen Shot - iPhone 11 - 2022-04-23 at 16 41 03

foterio commented 2 years ago

Same problem

csumrell commented 2 years ago

Same issue with

`

        <Stack.Screen name="LearnDetails" component={LearnDetailsScreen} />
    </Stack.Navigator>

`

adibkadir commented 1 year ago

Same problem

adibkadir commented 1 year ago

Did anybody solve this?

adibkadir commented 1 year ago

Ok... adding import { Animated } from 'react-native' solved the problem for me. Not sure why.

RichardBrowning commented 1 year ago

Encountered the same issue. I have to use this method so that I can pass some parameters from the navigator to the screen. But it does not work. Is there any other ways to pass the parameters?

pierroo commented 5 months ago

did you guys manage to fix it since? @RichardBrowning @foterio @csumrell sorry to ping you years later, time traveling here :D