@@ -34,7 +34,7 @@ class Image extends CloudinaryComponent {
3434 return ( this . element && this . element . ownerDocument ) ? ( this . element . ownerDocument . defaultView || windowRef ) : windowRef ;
3535 }
3636
37- prepareState ( props = this . props , context = this . context ) {
37+ prepareState ( props = this . props , context = this . getContext ( ) ) {
3838 let extendedProps = CloudinaryComponent . normalizeOptions ( context , props ) ;
3939 let url = this . getUrl ( extendedProps ) ;
4040 let state = { } ;
@@ -88,7 +88,7 @@ class Image extends CloudinaryComponent {
8888 componentDidUpdate ( prevProps ) {
8989 this . setState ( this . prepareState ( ) ) ;
9090 if ( this . state . responsive ) {
91- const wait = firstDefined ( this . props . responsiveDebounce , this . context . responsiveDebounce , 100 ) ;
91+ const wait = firstDefined ( this . props . responsiveDebounce , this . getContext ( ) . responsiveDebounce , 100 ) ;
9292 if ( this . listener ) {
9393 this . window && this . window . removeEventListener ( 'resize' , this . listener ) ;
9494 }
@@ -99,7 +99,7 @@ class Image extends CloudinaryComponent {
9999
100100 render ( ) {
101101 const { publicId, responsive, responsiveDebounce, children, ...options } =
102- CloudinaryComponent . normalizeOptions ( this . props , this . context ) ;
102+ CloudinaryComponent . normalizeOptions ( this . props , this . getContext ( ) ) ;
103103 const attributes = cloudinary . Transformation . new ( options ) . toHtmlAttributes ( ) ;
104104 const { url} = this . state ;
105105 return (
@@ -125,7 +125,7 @@ class Image extends CloudinaryComponent {
125125 } ;
126126
127127 applyBreakpoints ( width , steps , options ) {
128- options = CloudinaryComponent . normalizeOptions ( this . context , this . props , options ) ;
128+ options = CloudinaryComponent . normalizeOptions ( this . getContext ( ) , this . props , options ) ;
129129 let responsiveUseBreakpoints = options . responsiveUseBreakpoints ;
130130 if ( ( ! responsiveUseBreakpoints ) || ( responsiveUseBreakpoints === 'resize' && ! options . resizing ) ) {
131131 return width ;
0 commit comments