React Snippets
ts/tsx js/jsx 代码提示
/**
* Created by MeePwn
* https://github.com/maybewaityou
*
* description:
*
*/
import $1 from '$2';
import styled from 'styled-components';
import {
Button,
Image,
ImageStyle,
StyleSheet,
Text,
TextStyle,
View,
ViewStyle,
} from 'react-native';
this.props.
this.state.
this.setState({
$1
});
this.setState((prevState: any, props: any) => ({
$1
}));
source={$1}
style={$1}
numberOfLines={$1}
activeOpacity={$1}
resizeMode=$1
'cover'
'contain'
'stretch'
'repeat'
'center'
onPress={$1}
onChangeText={$1}
onChange={$1}
value={$1}
multiline={$1}
($1) => {
$2
}
setTimeout(() => {
$1
}, $2);
new Promise((resolve, reject) => {
$1
});
$1.forEach((item: any, index: number) => {
$2
});
$1.map((item: any) => $2);
$1.filter((item: any) => $2);
const { $2 } = $1;
const [ $2 ] = $1;
public constructor(props: Readonly<${1:IProps}>) {
super(props);
$1
}
public componentDidMount() {
$1
}
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
$1
}
public render() {
return (
$1
);
}
const styles = StyleSheet.create<IStyle>({
container: {
$1
},
});
flex: $1,
justifyContent: '${1:center}',
alignItems: '${1:center}',
alignSelf: '${1:center}',
'flex-start'
'flex-end'
'center'
'space-between'
'space-around'
borderBottomWidth: $1,
borderLeftWidth: $1,
borderRightWidth: $1,
borderTopWidth: $1,
borderWidth: $1,
flexDirection: $1,
'row'
'row-reverse'
'column'
'column-reverse'
height: $1,
width: $1,
margin: $1,
marginBottom: $1,
marginLeft: $1,
marginRight: $1,
marginTop: $1,
marginHorizontal: $1,
marginVertical: $1,
maxHeight: $1,
maxWidth: $1,
minHeight: $1,
minWidth: $1,
overflow: $1,
'visible'
'hidden'
'scroll'
padding: $1,
paddingBottom: $1,
paddingHorizontal: $1,
paddingLeft: $1,
paddingRight: $1,
paddingTop: $1,
paddingVertical: $1,
position: $1,
zIndex: $1,
top: $1,
left: $1,
right: $1,
bottom: $1,
fontSize: $1,
fontWeight: '$1',
'bold'
backgroundColor: '$1',
borderColor: '$1',
borderTopColor: '$1',
borderRightColor: '$1',
borderBottomColor: '$1',
borderLeftColor: '$1',
borderRadius: $1,
borderTopLeftRadius: $1,
borderTopRightRadius: $1,
borderBottomLeftRadius: $1,
borderBottomRightRadius: $1,
borderStyle: '$1',
'solid'
'dotted'
'dashed'
opacity: $1
/**
* Created by MeePwn
* https://github.com/maybewaityou
*
* description:
*
*/
import React from 'react';
export default (props: Readonly<any>) => (
<div style={styles.container}>
</div>
);
const styles = {
container: {
},
};
/**
* Created by MeePwn
* https://github.com/maybewaityou
*
* description:
*
*/
import React from 'react';
import {
Button,
Image,
ImageStyle,
StyleSheet,
Text,
TextStyle,
View,
ViewStyle,
} from 'react-native';
export interface IStyle {
container: ViewStyle;
}
export default (props: Readonly<any>) => (
<View style={styles.container}>
</View>
);
const styles = StyleSheet.create<IStyle>({
container: {
},
});