In this article, we are going to tackle the 5 basic CSS questions I get every time.
So let’s start.
By default, all the elements have a position: static. First, we will come to position absolute. An element with position: absolute is positioned relative to its nearest positioned ancestor. Remember, it…
While going through a plethora of resources to react, I happen to have stumbled upon a very interesting resource. This hook named as “useResource”, manages API request state under one hood. So what does it mean?
During an API call, most of us will be setting the following state variables: isLoading, errors, and data variables in our state. Now suppose instead of you setting these variables there is a hook that returns these values. You just have to use them directly in your template and can even dispatch those to your reducer function.
So how does it makes the API…
For devs who are not familiar with
Set, it is simply a group of definite, distinct objects. In layman terms, a set is a group of unordered unique elements. Think of
Set as an array but containing only unique values.
Since the implementation of sets is based on hash tables, they have a constant time operation of O(1).
let arr = [1,2,3,4,4];
const set = new Set(arr)
You don’t need classes, and you don’t need the .bind() method and the confusion it creates. This is what React said with its 16.8 release. Basically, functions make it easier to improve the performance of an application. Classes are confusing to both humans and machines.
The idea of this article to get into an internal understanding of how the new hooks work. For that, I will be recreating the custom useState hook.
This is not actual code of useState hook, but just an Idea. The actual useState hook is far more complex
You can find the full code here: