From 321df3fc9ad2075a863e4e1ed68ebdf9d40478e7 Mon Sep 17 00:00:00 2001 From: Chaitanya Bhagvan Date: Fri, 9 Jun 2017 15:33:10 +0530 Subject: [PATCH] Fix to load new themes themeCache would cache previously used styles even if the theme was changed. With this change, styles are recalculated from the top but parent lookups will still be fetched from the cache as before. --- src/connectStyle.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/connectStyle.js b/src/connectStyle.js index 75087cc..8e6f96c 100644 --- a/src/connectStyle.js +++ b/src/connectStyle.js @@ -269,17 +269,11 @@ export default (componentStyleName, componentStyle = {}, mapPropsToStyleNames, o } getOrSetStylesInCache(context, props, styleNames, path) { - if(themeCache && themeCache[path.join('>')]) { - // console.log('**************'); - - return themeCache[path.join('>')]; - } else { - resolvedStyle = this.resolveStyle(context, props, styleNames); - if(Object.keys(themeCache).length < 10000) { - themeCache[path.join('>')] = resolvedStyle; - } - return resolvedStyle; + resolvedStyle = this.resolveStyle(context, props, styleNames); + if(Object.keys(themeCache).length < 10000) { + themeCache[path.join('>')] = resolvedStyle; } + return resolvedStyle; } resolveStyle(context, props, styleNames) {