1_onHandleRemoveSubmittedPicture = async (i, pictureindex) => {
2 console.log('_onHandleRemoveSubmittedPicture: Entering Function');
3 console.log('_onHandleRemoveSubmittedPicture: index passed in is: ', pictureindex);
4//
5// in react-native, removing an item from an array. SelectedStoryPhotos is the array name, remember item is the array item, index is it's position in the arry, picture
6// index is the index of the array item you want removed passed in.
7//
8 this.setState(state => {
9 const selectedStoryPhotos = state.selectedStoryPhotos.filter((item, index) => pictureindex !== index);
10 return {selectedStoryPhotos,
11 };
12 });
13 console.log('_onHandleRemoveSubmittedPicture: selectedStoryPhotos after removal of index',pictureindex,'array = ',this.state.selectedStoryPhotos);
14}
1//
2// in react-native, removing an item from an array. SelectedStoryPhotos is the array name, remember item is the array item, index is it's position in the arry, picture
3// index is the index of the array item you want removed passed in.
4//
5 this.setState(state => {
6 const selectedStoryPhotos = state.selectedStoryPhotos.filter((item, index) => pictureindex !== index);
7 return {selectedStoryPhotos,
8 };
9 });
1const handleChange = (e) => {
2 const id = hospitalsDetails.filter(obj => obj.hospitalName == e.target.value)
3 setCurrentApp({ ...currentApp, [e.target.id]: e.target.value, ["hospitalID"]: id.hospitalID })
4}