Check out example codes for "collapse all code vscode". It will help you in understanding the concepts better.

Code Example 1

Use :
Ctrl + K + 0 to fold all 
Ctrl + K + J to unfold all

Learn ReactJs, React Native from akashmittal.com