RN: Move ART Canvas Workaround

Summary: Moves the `ReactNativeART` workaround to callers. There are legitimate use cases where you don't want to re-mount this component repeatedly.

Reviewed By: fkgozali

Differential Revision: D8928633

fbshipit-source-id: 0aafc1136ce9acb290e26a4f1a958819439bf2f0
This commit is contained in:
Tim Yung 2018-07-19 19:00:38 -07:00 committed by Facebook Github Bot
parent 9c71952f20
commit 7091f15602
1 changed files with 1 additions and 5 deletions

View File

@ -11,7 +11,6 @@
const Color = require('art/core/color');
const Path = require('ARTSerializablePath');
const Platform = require('Platform');
const Transform = require('art/core/transform');
const React = require('React');
@ -154,11 +153,8 @@ class Surface extends React.Component {
const height = extractNumber(this.props.height, 0);
const width = extractNumber(this.props.width, 0);
// WORKAROUND: Android bug in which canvas does not reflect size changes.
const key = Platform.OS === 'android' ? height + ',' + width : null;
return (
<NativeSurfaceView key={key} style={[this.props.style, {height, width}]}>
<NativeSurfaceView style={[this.props.style, {height, width}]}>
{this.props.children}
</NativeSurfaceView>
);