Part 1 of a Series of Blogs on Hooks
As we know, one of the most important part of React is managing state. Before hooks were introduced the only way to modify state was with class components and this.state. As of React v.16.8, Hooks let you use state and other React features without writing a class. For this blog we’ll focus on useState. It’s similar to this.setState in a class, except it doesn’t merge the old and new state together. There are some important things to note before using hooks.
A quick rundown..
Before getting into the virtual DOM we must first know about React. Unless you’ve been living under a rock, React is one of the most popular frameworks in the web development world. React was created originally at Facebook and has enjoyed solid growth since its inception.
In layman’s terms the DOM represents the UI of your application. It’s a programming interface for HTML and…
If you didn’t know..
We all know Airbnb as the app that connects travelers and those that want to rent homes and apartments. Would you believe it was built on Ruby on Rails? The company was founded in 2008 in San Francisco, California .It currently covers more than 100,000 cities and 220 countries worldwide.
We’ve all been there. Wasting copious amounts of time setting up the seemingly endless rails files just to find out something is terribly wrong. Now introducing the scaffold command. Once you’re in the correct directory you can slap this command into your terminal:
rails g scaffold name_of_file attribute1 attribute2 attribute3
This command will generate:
Keep in mind that if you make a mistake you can replace the “g” that stands for “generate” for a d for destroy. This will destroy all the files created by the original generate command. …
Coding tips that improve your daily life
Like many others I had lost my job during the 2020 pandemic. I had been working a career that I was no longer passionate about and looking for something to spark my fancy. After extensive research I noticed a trend that all the qualities of a career I wanted was in one thing…programming. That is when the seeds of interest were sowed and I began looking into a career in coding.
Fast forward a month later, I’m starting my first day at Flatiron’s Software Engineering course. Little did I know that something seemingly…