From f2a67f04f95ce68cf5da0f6c7ea50aa00ff2a37e Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 18 Aug 2017 22:35:13 +0700 Subject: [PATCH] Only use Proxy when available --- client/coral-framework/helpers/plugins.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/coral-framework/helpers/plugins.js b/client/coral-framework/helpers/plugins.js index 57caf2c46..3173115c2 100644 --- a/client/coral-framework/helpers/plugins.js +++ b/client/coral-framework/helpers/plugins.js @@ -45,8 +45,10 @@ export function isSlotEmpty(slot, reduxState, props = {}, queryData = {}) { // Memoize the warnings so we only show them once. const memoizedWarnings = []; +// withWarnings decorates the props of queryData with a proxy that +// prints a warning when accessing deeper props. function withWarnings(component, queryData) { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && window.Proxy) { // Show warnings when accessing queryData only when not in production. return mapValues(queryData, (value, key) => {