Restructured JavaScript snippets and added react snippets.