Permalink
Browse files

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 #14486

Differential Revision: D5274503

Pulled By: shergin

fbshipit-source-id: 09b81e6f7ae2ada7f68854e409909caafd85e56a
  • Loading branch information...
doochik authored and facebook-github-bot committed Jun 19, 2017
1 parent 86328e9 commit 8377b30b8d35283e325123ddd9047544d83ac11c
Showing with 2 additions and 5 deletions.
  1. +2 −5 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 {
<Image
{...props}
style={[
StyleSheet.absoluteFill,
{
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0,
// Temporary Workaround:
// Current (imperfect yet) implementation of <Image> overwrites width and height styles
// (which is not quite correct), and these styles conflict with explicitly set styles

0 comments on commit 8377b30

Please sign in to comment.