mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-23 04:00:04 +08:00
@@ -45,7 +45,7 @@ class SierpinskiTriangle extends React.Component {
|
||||
}
|
||||
|
||||
// introduce randomness to ensure that repeated runs don't produce the same colors
|
||||
const color = fn(renderCount * Math.random() / 20);
|
||||
const color = fn((renderCount * Math.random()) / 20);
|
||||
return (
|
||||
<Dot color={color} size={targetSize} x={x - targetSize / 2} y={y - targetSize / 2} />
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tree extends Component {
|
||||
|
||||
let result = (
|
||||
<Box color={id % 3} layout={depth % 2 === 0 ? 'column' : 'row'} outer>
|
||||
{depth === 0 && <Box color={id % 3 + 3} fixed />}
|
||||
{depth === 0 && <Box color={(id % 3) + 3} fixed />}
|
||||
{depth !== 0 &&
|
||||
Array.from({ length: breadth }).map((el, i) => (
|
||||
<Tree
|
||||
|
||||
@@ -12,7 +12,15 @@ const compose = (s1, s2) => {
|
||||
class View extends React.Component {
|
||||
render() {
|
||||
const { style, ...other } = this.props;
|
||||
return <div {...other} style={compose(viewStyle, style)} />;
|
||||
return (
|
||||
<div
|
||||
{...other}
|
||||
style={compose(
|
||||
viewStyle,
|
||||
style
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ const sizes = [20, 'small', 36, 'large', 60];
|
||||
|
||||
const ActivityIndicatorSizeExample = () => (
|
||||
<View style={styles.horizontal}>
|
||||
{sizes.map((size, i) => <ActivityIndicator key={i} size={size} style={styles.rightPadding} />)}
|
||||
{sizes.map((size, i) => (
|
||||
<ActivityIndicator key={i} size={size} style={styles.rightPadding} />
|
||||
))}
|
||||
<ActivityIndicator size="large" style={styles.large} />
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -105,21 +105,21 @@ const SwitchScreen = () => (
|
||||
/>
|
||||
|
||||
<DocItem
|
||||
description="(For compatibility with React Native. Equivalent to "activeTrackColor")"
|
||||
description='(For compatibility with React Native. Equivalent to "activeTrackColor")'
|
||||
label="compat"
|
||||
name="onTintColor"
|
||||
typeInfo="?color"
|
||||
/>
|
||||
|
||||
<DocItem
|
||||
description="(For compatibility with React Native. Equivalent to "trackColor")"
|
||||
description='(For compatibility with React Native. Equivalent to "trackColor")'
|
||||
label="compat"
|
||||
name="tintColor"
|
||||
typeInfo="?color"
|
||||
/>
|
||||
|
||||
<DocItem
|
||||
description="(For compatibility with React Native. Equivalent to "thumbColor")"
|
||||
description='(For compatibility with React Native. Equivalent to "thumbColor")'
|
||||
label="compat"
|
||||
name="thumbTintColor"
|
||||
typeInfo="?color"
|
||||
|
||||
@@ -28,8 +28,7 @@ const TextChildrenExample = () => (
|
||||
(Normal text,
|
||||
<Text style={{ fontWeight: 'bold' }}>
|
||||
(and bold
|
||||
<Text style={{ fontSize: 11, color: '#527fe4' }}>(and tiny inherited bold blue)</Text>
|
||||
)
|
||||
<Text style={{ fontSize: 11, color: '#527fe4' }}>(and tiny inherited bold blue)</Text>)
|
||||
</Text>
|
||||
)
|
||||
</Text>
|
||||
|
||||
@@ -51,7 +51,9 @@ export default class TouchableDelayEvents extends PureComponent {
|
||||
</Touchable>
|
||||
</View>
|
||||
<View style={styles.eventLogBox}>
|
||||
{this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}
|
||||
{this.state.eventLog.map((e, ii) => (
|
||||
<Text key={ii}>{e}</Text>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -47,7 +47,9 @@ export default class TouchableFeedbackEvents extends PureComponent {
|
||||
</Touchable>
|
||||
</View>
|
||||
<View style={styles.eventLogBox}>
|
||||
{this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}
|
||||
{this.state.eventLog.map((e, ii) => (
|
||||
<Text key={ii}>{e}</Text>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ const AppStateScreen = () => (
|
||||
|
||||
<DocItem
|
||||
name="static currentState"
|
||||
description="Returns the current state of the app: "active" or "background"."
|
||||
description='Returns the current state of the app: "active" or "background".'
|
||||
/>
|
||||
</Section>
|
||||
|
||||
|
||||
@@ -18,7 +18,12 @@ const Title = ({ children }) => (
|
||||
|
||||
export const Description = ({ children }) => (
|
||||
<AppText style={styles.description}>
|
||||
{insertBetween(() => <Divider key={Math.random()} />, React.Children.toArray(children))}
|
||||
{insertBetween(
|
||||
() => (
|
||||
<Divider key={Math.random()} />
|
||||
),
|
||||
React.Children.toArray(children)
|
||||
)}
|
||||
</AppText>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user