From 8377b30b8d35283e325123ddd9047544d83ac11c Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Mon, 19 Jun 2017 08:36:10 -0700 Subject: [PATCH] ImageBackground: use cached styles Summary: Replace object with cached styles from StyleSheet Create new style object may cause performance problems Check that ImageBackground position works the same way. Closes https://github.com/facebook/react-native/pull/14486 Differential Revision: D5274503 Pulled By: shergin fbshipit-source-id: 09b81e6f7ae2ada7f68854e409909caafd85e56a --- Libraries/Image/ImageBackground.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Libraries/Image/ImageBackground.js b/Libraries/Image/ImageBackground.js index 3995bfd47..291aca6cf 100644 --- a/Libraries/Image/ImageBackground.js +++ b/Libraries/Image/ImageBackground.js @@ -14,6 +14,7 @@ const Image = require('Image'); const React = require('React'); +const StyleSheet = require('StyleSheet'); const View = require('View'); /** @@ -49,12 +50,8 @@ class ImageBackground extends React.Component { overwrites width and height styles // (which is not quite correct), and these styles conflict with explicitly set styles