With the release of React Hooks, many people may be wondering, what is the benefit of hooks anyway, or even what are hooks?
Hooks are functions that allow you to “hook into” React state and lifecycle methods from within function components. An example of a “hook” is useState
. useState
is a hook that allows us to utilize stateful behavior from within a function component. We'll cover an example use of this built in hook in the next section.
Hooks allow us to make all of our components function components. …
The internet is a wonderful place, it’s filled with useful information, pictures of cute animals, and all sorts of other great things. Sometimes, we want to interact with these things, maybe create an account on a website.
Unfortunately, the protocol that the web is built on, HTTP (Hyper Text Transfer Protocol), is inherently stateless.
What does it mean that HTTP is stateless? Well, in HTTP, each command is executed independently, without any knowledge of the commands that came before it. So, how do we then create interactive sites that remember users and their actions?
Ruby on Rails is fantastic for easily creating a powerful and flexible back end. With the popularity and flexibility of JavaScript, Ruby is not often used to create a front end. However, I argue that limiting yourself to HTML, Ruby, and CSS can help developers to learn to build better websites overall. By testing how far we can push the dynamism of our web pages without JavaScript, we can learn clever uses of cookies and reduce reliance on performance-impacting scripts.
A good way to practice using cookies with Rails is to create a simple search and sort function for a website. …
Often, as developers we find ourselves running into an error that is more confusing than helpful. When we turn to Google to help us, we can easily end up with hundreds of thousands of search results for a single search.
Learning how to properly navigate through these many results can make a developer’s life significantly easier.
We’ll use a simple error as an example:
Your best bet is most likely going to be to copy the important parts of that error into a search and maybe add a few key terms related to what you are trying to accomplish.
So, now we can take that error message and our extra search terms and throw them into Google, looking something like…