Last active
April 15, 2021 15:50
-
-
Save MelodicCrypter/cc488590efc1b15c5b3559c3ab58076d to your computer and use it in GitHub Desktop.
Webstorm Live Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code: edf | |
// Desc: For export components using index | |
export { default } from '.$END$'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code: rfc | |
// Desc: Functional Component Expression | |
import React from 'react'; | |
const $Component$ = () => { | |
return ( | |
<div> | |
<p>test$END$</p> | |
</div> | |
); | |
} | |
export default $Component$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code: rnx | |
// Desc: Basic RN Functional Component | |
import React, { useState, useEffect } from 'react' | |
import { Text, StyleSheet, View } from 'react-native' | |
export default function $Component$() { | |
return ( | |
<View style={styles.mainWrap}> | |
<Text> $Component$ screen </Text> | |
</View> | |
) | |
} | |
// Styles for this $Component$ | |
const styles = StyleSheet.create({ | |
mainWrap: { | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}) | |
$END$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code: rnxt | |
// Desc: RN Functional Component with Typescript | |
import React, { useState, useEffect } from 'react' | |
import { Text, StyleSheet, View } from 'react-native' | |
interface Props { | |
test?: string; | |
} | |
export default function $Component$({ test }: Props) { | |
return ( | |
<View> | |
<Text> $Component$ view </Text> | |
</View> | |
) | |
} | |
// Styles for this $Component$ | |
const styles = StyleSheet.create({ | |
mainWrap: { | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}) | |
$END$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code: rfet | |
// Desc: Funtional Component Expression with TypeScript minimal | |
import React from 'react'; | |
// interface Props {} | |
const $Component$ = (): React.ReactElement => { | |
return ( | |
<div> | |
<p>test$END$</p> | |
</div> | |
); | |
} | |
export default $Component$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code: rfet+ | |
// Desc: Funtional Component Expression with TS and interface defaults | |
import React, { FC, ReactNode } from 'react'; | |
interface Props { | |
children?: ReactNode; | |
title?: string; | |
on?: boolean; | |
size?: number; | |
getName?: () => {}; | |
} | |
const $Component$ = ({ children, title, on, size, getName }: Props): React.ReactElement => { | |
return ( | |
<div> | |
<p>test$END$</p> | |
</div> | |
); | |
} | |
export default $Component$; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment