Month: June 2021
-
Looping through an object with forEach
With example data like this: which console logs “bird”
-
Making React use relative paths
If you build something and then upload it to www.website.com/newFolder and it breaks, you need to make it relative. To do this, just add to your package.json and rebuild.
-
Disable auto closing tags in Visual Studio Code
I personally find this feature counter productive. To do this, press Control/Command + comma to open the settings. Then put “autoClosingTags” into the search and untick it.
-
Conditional classes and toggling state
Here’s a basic example: And you can toggle the state like so: Demo here.
-
Basic React Class Component
Just a basic example of a React Class component: