diff --git a/src/native-common/Styles.ts b/src/native-common/Styles.ts index 46774829..89eac7e9 100644 --- a/src/native-common/Styles.ts +++ b/src/native-common/Styles.ts @@ -195,6 +195,15 @@ export class Styles extends RX.Styles { } if (def.flex !== undefined) { + // In development mode, see if we're going to overwrite explicit flexGrow + // or flexShrink attributes. It's a programming error to specify these in + // combination with flex. + if (AppConfig.isDevelopmentMode()) { + if (adaptedRuleSet.flexGrow !== undefined || adaptedRuleSet.flexShrink !== undefined) { + console.error('Conflicting rules for flex specified.'); + } + } + let flexValue = def.flex; delete adaptedRuleSet.flex; if (flexValue > 0) { diff --git a/src/web/Styles.ts b/src/web/Styles.ts index f0b18310..70b48413 100644 --- a/src/web/Styles.ts +++ b/src/web/Styles.ts @@ -265,6 +265,15 @@ export class Styles extends RX.Styles { } if (def.flex !== undefined) { + // In development mode, see if we're going to overwrite explicit flexGrow + // or flexShrink attributes. It's a programming error to specify these in + // combination with flex. + if (AppConfig.isDevelopmentMode()) { + if (def.flexGrow !== undefined || def.flexShrink !== undefined) { + console.error('Conflicting rules for flex specified.'); + } + } + let flexValue = def.flex as number; delete def.flex;