React
Shortcut |
Snippet |
_s or usestate or _usestate |
const [Name, setName] = useState(value); |
_u or useEffect |
useEffect |
_rfc or rfc |
react component (Arrow function) |
_rcc or rcc |
react class component |
_cdm or cdm |
componentDidMount |
_cwm or cwm |
componentWillMount |
React Native
Shortcut |
Snippet |
_rnc or rnc |
react native component (Arrow function) |
_rncc or rncc |
react native class component |
_dimensions or dimensions |
const screenHeight = Dimensions.get('screen').height; const screenWidth = Dimensions.get('screen').width; |
|
|
Basic - Commonly Used
Shortcut |
Snippet |
_map or map |
js map function (elem, i) as parameters |
_foreach or foreach |
foreach |
_async or async |
async arrow function |
_arf or arf |
arrow function |
_c or log or _con or con |
console.log |
_warn or warn |
console.warn |
_error or error |
console.error |
_try or try |
try catch block with console.error() |
React Native Firebase
Shortcut |
Snippet |
_firestore |
import firestore from '@react-native-firebase/firestore'; |
_auth |
import auth from '@react-native-firebase/auth'; |
_fire |
import firebase from '@react-native-firebase/app'; |
_fget |
const ${1:variableName} = await firestore().collection('${2:collection}').get(); |
_fonsnapshot |
firebse firestore onSnapShot |
asyncstorage or _impasyncstorage |
import AsyncStorage from '@react-native-community/async-storage'; |
_setItem or setItem |
AsyncStorage.setItem() |
_getItem or getItem |
AsyncStorage.getItem() |
| |