react native navigation shared element
import { createSharedElementStackNavigator } from 'react-navigation-shared-element';
const stackNavigator = createSharedElementStackNavigator(
{
List: ListScreen,
Detail: DetailScreen,
},
{
initialRouteName: 'List',
}
);
const AppContainer = createAppContainer(stackNavigator);// ListScreen.js
import { SharedElement } from 'react-navigation-shared-element';
class ListScreen extends React.Component {
renderItem(item) {
const { navigation } = this.props;
return (
<TouchableOpacity onPress={() => navigation.push('Detail', { item })}>
<SharedElement id={`item.${item.id}.photo`}>
<Image source={item.photoUrl} />
</SharedElement>
</TouchableOpacity>
);
}
}// DetailScreen.js
const DetailScreen = (props) => {
const item = props.navigation.getParam('item');
return (
<SharedElement id={`item.${item.id}.photo`}>
<Image source={item.photoUrl} />
</SharedElement>
);
};
DetailScreen.sharedElements = (navigation, otherNavigation, showing) => {
const item = navigation.getParam('item');
return [`item.${item.id}.photo`];
};
Also in JavaScript:
- javascript Count the frequency of a value in an array
- datepicker select date programmatically bootstrap
- pyspark json multiline
- kill all node server mac terminal
- refresh javascript using require
- checkbox default value and checked value get in jquery
- js what does var mean
- how to create a smooth effect in javasript
- javascript check if key exists in object
- geoJson
- how to set time with jwt token in node js
- jquery remove multiple class
- convert camelcase to sentence case javascript
- sleeping in js
- replace all javascript
- heroku get requests return html code in production
- js set iframe src
- js for each item do
- Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
- object values javascript
- angular how to copy text with button
- const userMessage Reaction = new UserMessage Reaction({ _id: mongoose.Types.ObjectId(), userId: "USERID", userName: "TESTUSERNAME", messageId: "TESTMESSAGEID", time: "TESTTIME" });
- js math random
- append to top javascript