Skip to content

Commit

Permalink
RN: Move ART Canvas Workaround
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yungsters authored and facebook-github-bot committed Jul 20, 2018
1 parent 9c71952 commit 7091f15
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Libraries/ART/ReactNativeART.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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>
);
Expand Down

0 comments on commit 7091f15

Please sign in to comment.