This is a quick intro to React Hooks.
This article is meant to set the ground for the next article in which I will show how to use those simple techniques to achieve AOP (Aspect-Oriented Programming), and will also compare it to the new comosition API commig from Vue.js
But first thing first, lets quickly review what are React Hooks.
Hooks are a new addition in React 16.8 and a major shift in the coding style:
The Obvious Benefits:
Hooks are a new addition in React 16.8, I’ve reviewed the essence of that in a previous article
AOP is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns.
React Hooks and Vue 3 Composition API are all about that, lets code and discuss the benefits.
Imagine a Large Component (Container / Page) with much logic, it has 3000 lines of code. I know what you’re thinking: “you must have designed it wrong and it could be broken to smaller components”,
I will politely respond that this is not the case as my component…
Vue.js provides an easy way to use dynamic components in our app:
<component is=”h1" > Hola </component>
In the snippet above we are rendering an <h1>, lets render a dynamic component:
<component :is=”selectedCmp” />
Here, the selectedCmp is a variable holding the desired component name.
If we want to dynamically switch between components, they should have a similar API, for example:
We are passing down a prop called info and expecting an event named inform.
Dynamic components are a shape of Polymorphism -
We use different components with similar API.
Let us build a dynamic…
React is a popular choice for companies selecting a frontend framework.
at misterBIT we have selected Vue over React for all current projects.
In this article I will go through different aspects and compare them, with simple code samples so you can easily experience the superiority of Vue yourself.
Side note: please please do not take it personal, I have full appreciation for all frameworks and maintainers, we are just developers seeking for the best tool to finish the job and go make love.
In my previous article I made some people angry, as I briefly went through many aspects of modern web apps development, and expressed my dislikes of both React and Angular compared to Vue.js.
In this article I will go deeper in two aspects: (1)I will present the concept of change detection and compare the strategies of Angular vs Vue. and (2) we will check how each framework handles dynamic components (which is a feature that always reveals the pipes of the engine)
Lets do it.
We make the model (state) of the application visible to user by the process we…
Angular (2) created a bloated, hard-to-master, prematurely-abstracted, many-faces creature that suffers from many issues. (Here is my following article focused on Angular pains)
React is an idealistic limited UI library, that focuses only on a small subset of challenges while building modern web apps.
Vue.js is the right tool for your any-scale project, use it today and live long and prosper.
The software world has gone through some radical changes and developers from various colors and genders find their way into web technologies. The client side (now known as Frontend) is becoming rich (again!) with much logic and state.
I have already went through such technological revolution, it was back in the 90s when I stopped working on Main Frames that took the space of a track, and started coding in C on PC computers.
Later on came that time where C developers where out shined by C++ coders, it was a time with much ambitions, hormones, and Object oriented.
If you are in the frontend scene, you are probably aware of the recent debate about state management and when it is actually needed. My opinion is that it is super relevant almost everywhere. Let me elaborate.
Building Frontends - Single page applications, is complex because
there is so much state.
Some of this state is arriving at the front via AJAX or websockets but much of this state has nothing to do with the server, examples: isPlaying, isTyping, selectedItems, currWizardStep.
the real issue is data changing over time and efficient re-rendering (when the page is big, DOM access is…