diff --git a/src/components/Image/index.js b/src/components/Image/index.js index 6bb4222f..f0b228db 100644 --- a/src/components/Image/index.js +++ b/src/components/Image/index.js @@ -11,6 +11,8 @@ const STATUS_LOADING = 'LOADING' const STATUS_PENDING = 'PENDING' const STATUS_IDLE = 'IDLE' +const imageStyleKeys = Object.keys(ImageStylePropTypes) + const styles = { initial: { alignSelf: 'flex-start', @@ -176,7 +178,7 @@ class Image extends React.Component { const isLoaded = this.state.status === STATUS_LOADED const defaultImage = defaultSource.uri || null const displayImage = !isLoaded ? defaultImage : source.uri - const resolvedStyle = pickProps(style, Object.keys(ImageStylePropTypes)) + const resolvedStyle = pickProps(style, imageStyleKeys) const backgroundImage = displayImage ? `url("${displayImage}")` : null /** diff --git a/src/components/Text/index.js b/src/components/Text/index.js index 9d58672a..336d75a0 100644 --- a/src/components/Text/index.js +++ b/src/components/Text/index.js @@ -3,6 +3,8 @@ import CoreComponent from '../CoreComponent' import React, { PropTypes } from 'react' import TextStylePropTypes from './TextStylePropTypes' +const textStyleKeys = Object.keys(TextStylePropTypes) + const styles = { initial: { color: 'inherit', @@ -43,7 +45,7 @@ class Text extends React.Component { render() { const { children, component, numberOfLines, style, testID } = this.props - const resolvedStyle = pickProps(style, Object.keys(TextStylePropTypes)) + const resolvedStyle = pickProps(style, textStyleKeys) return (