From 0372cb4f6b4d08ce61776c8d57eb4f2dffb23ae0 Mon Sep 17 00:00:00 2001 From: Amr Noman Date: Sun, 12 Mar 2017 03:39:56 +0300 Subject: [PATCH] fix a bug that happens when variable names are minified --- src/components/CloudinaryComponent/CloudinaryComponent.js | 2 +- src/components/Transformation/Transformation.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/CloudinaryComponent/CloudinaryComponent.js b/src/components/CloudinaryComponent/CloudinaryComponent.js index 2785096..10ee20f 100644 --- a/src/components/CloudinaryComponent/CloudinaryComponent.js +++ b/src/components/CloudinaryComponent/CloudinaryComponent.js @@ -26,7 +26,7 @@ class CloudinaryComponent extends Component { if(children === undefined || children === null) return null; let mapped = React.Children.map(children, child =>{ let options = {}; - if (child.type && child.type.name === "Transformation"){ + if (child.type && child.type._type === "Transformation"){ options = CloudinaryComponent.normalizeOptions(child.props, child.context); } let childOptions = this.getChildTransformations(child.props.children); diff --git a/src/components/Transformation/Transformation.js b/src/components/Transformation/Transformation.js index 994b470..016a4a8 100644 --- a/src/components/Transformation/Transformation.js +++ b/src/components/Transformation/Transformation.js @@ -5,6 +5,8 @@ import CloudinaryComponent from '../CloudinaryComponent'; * Define a transformation that is applied to the parent tag. */ class Transformation extends CloudinaryComponent { + static _type = "Transformation"; + constructor(props) { super(props); }