mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-25 07:34:45 +00:00
Documentation fixes
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
|
||||
#### PropTypes
|
||||
|
||||
All other props are transferred directly to the `element`.
|
||||
All other props are transferred to the resulting `img`.
|
||||
|
||||
+ `accessibilityLabel`: `string`
|
||||
+ `async`: `bool` (TODO)
|
||||
+ `className`: `string`
|
||||
+ `source`: `string`
|
||||
+ `source`: `object`
|
||||
+ `style`: `ImageStylePropTypes`
|
||||
|
||||
#### ImageStylePropTypes
|
||||
@@ -20,10 +18,11 @@ All other props are transferred directly to the `element`.
|
||||
#### Examples
|
||||
|
||||
```js
|
||||
import {Image} from 'react-web-sdk';
|
||||
import React, {PropTypes} from 'react';
|
||||
import React, { Image } from 'react-native-web'
|
||||
|
||||
class Avatar extends React.Component {
|
||||
const { Component, PropTypes } = React;
|
||||
|
||||
class Avatar extends Component {
|
||||
static propTypes = {
|
||||
size: PropTypes.oneOf(['small', 'normal', 'large']),
|
||||
user: PropTypes.object
|
||||
@@ -37,10 +36,10 @@ class Avatar extends React.Component {
|
||||
return (
|
||||
<Image
|
||||
accessibilityLabel={`${user.name}'s profile picture`}
|
||||
source={user.avatarUrl}
|
||||
source={{ uri: user.avatarUrl }}
|
||||
style={ ...style.base, ...style[this.props.size] }
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ Text layout and styles.
|
||||
|
||||
#### PropTypes
|
||||
|
||||
All other props are transferred directly to the `element`.
|
||||
All other props are transferred directly to the `component`.
|
||||
|
||||
+ `element`: `func` or `string` (default `"div"`)
|
||||
+ `component`: `func` or `string` (default `'div'`)
|
||||
+ `style`: `TextStylePropTypes`
|
||||
|
||||
#### TextStylePropTypes
|
||||
@@ -17,10 +17,11 @@ All other props are transferred directly to the `element`.
|
||||
## Examples
|
||||
|
||||
```js
|
||||
import {Text} from 'react-web-sdk';
|
||||
import React, {PropTypes} from 'react';
|
||||
import React, { Text } from 'react-native-web'
|
||||
|
||||
class PrettyText extends React.Component {
|
||||
const { Component, PropTypes } = React
|
||||
|
||||
class PrettyText extends Component {
|
||||
static propTypes = {
|
||||
color: PropTypes.oneOf(['white', 'gray', 'red']),
|
||||
size: PropTypes.oneOf(['small', 'normal', 'large']),
|
||||
|
||||
@@ -4,7 +4,7 @@ Text input layout and styles.
|
||||
|
||||
#### PropTypes
|
||||
|
||||
All other props are transferred directly to the `element`.
|
||||
All other props are transferred directly to the `component`.
|
||||
|
||||
+ `component`: `func` or `string` (default `"div"`)
|
||||
+ `style`: `TextStylePropTypes`
|
||||
|
||||
@@ -8,7 +8,7 @@ any type.
|
||||
|
||||
All other props are transferred directly to the `element`.
|
||||
|
||||
+ `element`: `func` or `string` (default `"div"`)
|
||||
+ `component`: `func` or `string` (default `'div'`)
|
||||
+ `pointerEvents`: `oneOf('all', 'box-only', 'box-none', 'none')`
|
||||
+ `style`: `ViewStylePropTypes`
|
||||
|
||||
@@ -21,7 +21,7 @@ All other props are transferred directly to the `element`.
|
||||
+ `color`: `string`
|
||||
+ `opacity`: `number`
|
||||
|
||||
## ViewStyleDefaultProps
|
||||
## ViewDefaultStyle
|
||||
|
||||
Implements the default styles from
|
||||
[facebook/css-layout](https://github.com/facebook/css-layout).
|
||||
@@ -43,7 +43,7 @@ Implements the default styles from
|
||||
`right`, `bottom` do something when not specifying `position:absolute`.
|
||||
|
||||
```js
|
||||
const ViewStyleDefaultProps = {
|
||||
const ViewDefaultStyle = {
|
||||
alignItems: 'stretch', // 1
|
||||
borderWidth: 0,
|
||||
borderStyle: 'solid',
|
||||
|
||||
Reference in New Issue
Block a user