mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-29 12:54:53 +08:00
Lint fixes
This commit is contained in:
@@ -6,20 +6,11 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropChildren from './examples/PropChildren';
|
import PropChildren from './examples/PropChildren';
|
||||||
import UIExplorer, {
|
import UIExplorer, { Description, DocItem, Section, storiesOf } from '../../ui-explorer';
|
||||||
AppText,
|
|
||||||
Code,
|
|
||||||
Description,
|
|
||||||
DocItem,
|
|
||||||
Section,
|
|
||||||
storiesOf
|
|
||||||
} from '../../ui-explorer';
|
|
||||||
|
|
||||||
const ImageBackgroundScreen = () => (
|
const ImageBackgroundScreen = () => (
|
||||||
<UIExplorer title="ImageBackground" url="1-components/ImageBackground">
|
<UIExplorer title="ImageBackground" url="1-components/ImageBackground">
|
||||||
<Description>
|
<Description>A image component with support for child content.</Description>
|
||||||
A image component with support for child content.
|
|
||||||
</Description>
|
|
||||||
|
|
||||||
<Section title="Props">
|
<Section title="Props">
|
||||||
<DocItem name="...Image props" />
|
<DocItem name="...Image props" />
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import StyleSheet from '../../apis/StyleSheet';
|
|||||||
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
import ViewPropTypes from '../View/ViewPropTypes';
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import { any, bool, func, number, oneOf, oneOfType, shape, string } from 'prop-types';
|
import { bool, func, number, oneOf, oneOfType, shape, string } from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
const emptyObject = {};
|
const emptyObject = {};
|
||||||
@@ -225,7 +225,9 @@ class Image extends Component<*, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.children) {
|
if (this.props.children) {
|
||||||
throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.');
|
throw new Error(
|
||||||
|
'The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user