This extension is focused on Javascript
and React
.
-See detailed description-
https://github.com/beqa-dogonadze/React-Js-Snippets#readme
fl
creates a for loop
for (let i = 0; i < arg; i++) {
///
}
fn
creates a function component
const App = () => {
return <div>Start</div>
}
export default App
each
creates a forEach function
forEach((el) => {
return
})
ter
ternary operator
condtion ? true : false
import useState from 'react'
use
creates a useState hook
const [count, setCount] = useState(0)
arf
creates arrow function
const hello = () => {
return
}
eff
creates useEffect hook
useEffect(() => {
///
})
imeff
impoerts useEffect
import useEffect from 'react'
arr
creates empty array
const arr = []
cl
creates console.log function
console.log()
javafet
creates API request using fetch
useEffect(() => {
fetch('https://dog.ceo/api/breeds/image/random')
.then((response) => response.json())
.then((data) => setFunction(data.message))
}, [])
axi
creates API request using axios
useEffect(() => {
axios
.get(request.requestName)
.then((response) => setFunction(response.data.results))
}, [])
imax
import axios
import axios from 'axios'
ed
export default
export default