File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,11 @@ export default class CloudinaryContext extends CloudinaryComponent {
1717 }
1818
1919 getChildContext ( ) {
20- let { children, ...otherProps } = this . props ;
2120 let context = { } ;
2221 // only pass valid Cloudinary options
2322 CloudinaryComponent . VALID_OPTIONS . forEach ( key => {
24- let val = otherProps [ key ] || this . context [ key ] ;
25- if ( val !== null && val !== undefined ) {
23+ let val = this . props [ key ] || this . context [ key ] ;
24+ if ( val !== undefined && val !== null ) {
2625 context [ key ] = val ;
2726 }
2827 } ) ;
Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ export default class Image extends CloudinaryComponent {
66 constructor ( props , context ) {
77 super ( props , context ) ;
88 var options = this . getOptions ( props , context ) ;
9- var options2 = options ;
10- let cl = cloudinary . Cloudinary . new ( options2 ) ;
11- var url = cl . url ( props . publicId , options2 ) ;
9+ let cl = cloudinary . Cloudinary . new ( options ) ;
10+ var url = cl . url ( props . publicId , options ) ;
1211 this . state = { url : url } ;
1312 }
1413
@@ -45,7 +44,6 @@ export default class Image extends CloudinaryComponent {
4544
4645 render ( ) {
4746 var options = this . getOptions ( this . props , this . context ) ;
48- var { publicId, transformation, ...other } = this . props ;
4947 var attributes = cloudinary . Transformation . new ( options ) . toHtmlAttributes ( ) ;
5048 return (
5149 < img { ...attributes } src = { this . state . url } />
You can’t perform that action at this time.
0 commit comments