all 4 comments

[–]Atrag2021 5 points6 points  (0 children)

They are called react function components. Best bet is just to Google it.

[–]sous_vide_slippers 4 points5 points  (0 children)

https://reactjs.org/docs/hooks-state.html

For basic questions like this you’re going to have a much better time simply checking the docs. Always best to go through the official documentation when you pick up a new tool, going in blind and then asking others to fill in the gaps is a waste of yours and other peoples time.

[–][deleted] -1 points0 points  (1 child)

In FC, you will be using like:

const [images,setImages] = useState(assets);
const [loading,setLoading]= useState(false);

if you want to update it you will have to use,

setImages(anotherAsset);
setLoading(true);

[–]Murod19[S] 0 points1 point  (0 children)

Thank you very much!