Я использую «react-navigation-shared-element»: «5.0.0-alpha0», «react-native-shared-element»: «^ 0.7.0» и response-navigation 5
Я получаю это предупреждение RNSharedElementTransition недоступен, вы забыли привязать react-native-shared-element
к своему проекту? Ничего не ломается, просто не работает. Ручное связывание отсутствует в документации по react-native-shared-animation
Моя версия реакции - 16.9
My Stack Navigator
const Stack = createSharedElementStackNavigator ()
<Stack.Navigator headerMode='none'>
<Stack.Screen name='Resource' component={Home} />
<Stack.Screen
name='Resource_Detail'
component={ResourceDetail}
sharedElementsConfig={(route, otherRoute, showing) => {
const { id } = route.params;
return [{
id: id,
animation: 'move'
}];
}} />
</Stack.Navigator>
SharedElement в домашней странице
<TouchableOpacity onPress={() => navigation.navigate('Resource_Detail', { thumb, name, author, url, subCode, semesters, data, id })}>
<View style={styles.container}>
<SharedElement id={`${id}`}>
<Image style={styles.thumbImg} source={{ uri: thumb }} />
</SharedElement>
<Text style={styles.secondaryText}>{author} </Text>
<Text style={[styles.primaryText, { color }]}>{name}</Text>
</View>
</TouchableOpacity>
SharedElement в деталях ресурса
<SharedElement id={`${id}`}>
<Image style={styles.img} source={{ uri: thumb }} resizeMode='cover' />
</SharedElement>