When we know why this happens and how to fix it, it’s all easy actually.
sort method and it can be used like this:
const arr = [5, 7, 1, 3];
// logs: [ 1, 3, 5, 7 ]
Just as we expected, right? It sorts the array in an ascending order.
Let’s look at another example:
const arr = [15, 17, 1…
State management for React applications is a concept with a lot of alternative solutions. We have things like redux, mobx, mobx-state-tree, apollo-client and many more. They all have many different and similar approaches, learning curves, complexities and simplicities. They are very very useful for many situations. But I think, they add a lot of unnecessary layers for a lot of applications. Because, you already have a state management solution and it’s built-in to React. It’s React itself…
With good component composition, creating minimal and maintainable components, using Context API and hooks, you can easily manage your application state. …