@@ -164,42 +164,42 @@ export default class ImageView extends Component<PropsType, StateType> {
164164 Dimensions . addEventListener ( 'change' , this . onChangeDimension ) ;
165165 }
166166
167- componentWillReceiveProps ( nextProps : PropsType ) {
167+ componentDidUpdate ( ) {
168168 const { images, imageIndex, isVisible} = this . state ;
169169
170170 if (
171- typeof nextProps . isVisible !== 'undefined' &&
172- nextProps . isVisible !== isVisible
171+ typeof this . props . isVisible !== 'undefined' &&
172+ this . props . isVisible !== isVisible
173173 ) {
174- this . onNextImagesReceived ( nextProps . images , nextProps . imageIndex ) ;
174+ this . onNextImagesReceived ( this . props . images , this . props . imageIndex ) ;
175175
176176 if (
177- images !== nextProps . images ||
178- imageIndex !== nextProps . imageIndex
177+ images !== this . props . images ||
178+ imageIndex !== this . props . imageIndex
179179 ) {
180180 const imagesWithoutSize = getImagesWithoutSize (
181- addIndexesToImages ( nextProps . images )
181+ addIndexesToImages ( this . props . images )
182182 ) ;
183183
184184 if ( imagesWithoutSize . length ) {
185185 Promise . all ( fetchImageSize ( imagesWithoutSize ) ) . then (
186186 updatedImages =>
187187 this . onNextImagesReceived (
188188 this . setSizeForImages ( updatedImages ) ,
189- nextProps . imageIndex
189+ this . props . imageIndex
190190 )
191191 ) ;
192192 }
193193 }
194194
195195 this . setState ( {
196- isVisible : nextProps . isVisible ,
196+ isVisible : this . props . isVisible ,
197197 isFlatListRerendered : false ,
198198 } ) ;
199199
200200 this . modalBackgroundOpacity . setValue ( 0 ) ;
201201
202- if ( nextProps . isVisible ) {
202+ if ( this . props . isVisible ) {
203203 Animated . timing ( this . modalAnimation , {
204204 duration : 400 ,
205205 toValue : 1 ,
0 commit comments