Interview of @matheusml about #redux zero, a light state management solution for #reactjs

  • Redux Zero is a library which offers a simple way to handle state in modern applications.
  • With Redux Zero your component can focus 100% on the UI and just call the actions to update the state: – – Last but not least, plug the whole thing in your index file: – – Redux is great, but in some cases, it’s way too much.
  • With Redux Zero you just have a store and some actions.
  • One of our developers here at Concrete, Miguel Albernaz, was using this gist as a state management solution instead of Redux.
  • Redux Zero is one of the lightest state management solutions I’ve seen so far.

Although using Redux is straight-forward once you understand the approach and its nuances, after a while it gets repetitive. It’s easy to end up with a lot of “boilerplate” code that wires all the logic together. For this reason, multiple solutions addressing the issue have appeared.
Continue reading “Interview of @matheusml about #redux zero, a light state management solution for #reactjs”

Vue vs React: Battle of the Javascript Frameworks

  • I’ve created two nearly identical sample applications, one in Vue and one in React, if you’d like to give either framework a shot in the context of the samples in this article.
  • The biggest difference is that React popularized a Virtual DOM (we’ll get into this later) and created a new syntax called JSX that allows developers to write HTML in JavaScript.
  • Unlike earlier JavaScript frameworks that had ‘batteries included,’ both React and Vue are fairly barebones with functionality like routing and state management handled by separate frameworks.
  • Both React and Vue are focused solely on the UI layer, and leave functionality such as routing and state handling to companion frameworks.
  • In Vue there’s no need to call a state management function like , as the data parameter on the Vue object acts as the holder for application data.

React vs Vue.js. Are you in the market for a shiny new JavaScript UI framework? Find out the main similarities & differences between these two popular ones.
Continue reading “Vue vs React: Battle of the Javascript Frameworks”

Debounce Your React and Redux Code to Improve Performance

Debounce Your #ReactJS and Redux #Code to Improve Performance:  by @TreyHuffine #JavaScript

  • Debounce Your React and Redux Code to Improve PerformanceA debounce is a tool that every web developer should have in their kit.
  • Let’s take a look at the individual steps to understand how much we actually saved.After the debounce time expires after the final key press, the first step is to make our API call.
  • Since we have debounced the function that fetches from our API, we only make the request once at the end of typing into the input.There are two things happening here — retrieving projects from the database and then performing heavy calculations to filter and sort the data.
  • By debouncing, we prevent the setState() which serves to significantly reduce the number of times we force React to reconcile and append the list to the DOM.Without a debounce, this component would be almost unusable with such a large amount of data.
  • In addition, you should consider wrapping any interaction that triggers excessive calculations or API calls with a debounce.

A debounce is a tool that every web developer should have in their kit. It improves performance by limiting the number of expensive calculations, API calls, and DOM updates. Although the debounce…
Continue reading “Debounce Your React and Redux Code to Improve Performance”

MobX (with Decorators) in create-react-app

MobX (with Decorators) in create-react-app  #MobX #ReactJS

  • If you are using create-react-app as your application boilerplate, you most likely run into the questions of how to setup MobX and how to use decorators in create-react-app.
  • After scaffolding your application with create-react-app on the command line, you can install mobx and mobx-react: – – Whereas the former is used as your state management solution, the latter is used to connect the state layer to your React view layer.
  • The current situation is that the maintainers of create-react-app are holding decorators back until Babel supports them in a stable stage: – – But what if you want to use decorators for your create-react-app + MobX application right now?
  • Fortunately there exists one sample project that already demonstrates how to use MobX with decorators in a Next.js application.
  • After showing all these different alternatives, using MobX with or without decorators in a plain React, a create-react-app or Next.js application, you have no excuse anymnore to give MobX as alternative to Redux a shot.

Everything to know about using MobX with and without decorators in a create-react-app with React. MobX doesn’t need necessarily decorators. But you can activate them by ejecting your application …
Continue reading “MobX (with Decorators) in create-react-app”

8 things to learn in React before using Redux

8 things to learn in #ReactJS before using #Redux:

  • A component can manage a whole lot of state, pass it down as props to its child components and pass a couple of functions along the way to enable child components to alter the state in the parent component again.
  • Component A is the only component that manages local state but passes it down to its child components as props.
  • In addition, it passes down the necessary functions to enable B and C to alter its own state in A.

    Now, half of the local state of component A is consumed as props by component C but not by component B.

  • When you lift the local state management down to component C, all the necessary props don’t need to traverse down the whole component tree.
  • When a library such as Redux “connects” its state managements layer with React’s view layer, you will often run into a higher order component that takes care of it (connect HOC in react-redux).

Facts about React that should be known before using Redux (or MobX). Most important: Learn React first, then opt-in Redux…
Continue reading “8 things to learn in React before using Redux”

Vue.js vs React.js: A Real Tight Comparison between the two

Vue.js vs React.js: A Real Tight Comparison between the two

☞

  • Even though you get profound community support with both, one can feel extremely comfortable with Vue’s Guide, setup process, property names and many other.
  • Whereas in Vue, component dependencies will be automatically handled and tracked during its render, so the system itself can re-render related components in accordance with state changes.
  • Being more popular of the two, React, prefers handing over the state management and routing solutions to it’s wide extended community.
  • Vue doesn’t offer solid options as native React, but given the active collaboration and development, it’s expected to catch up sooner rather than later.
  • It comes across strongly as a framework that reinforces the weak link of both Angular and React.

Vue.js is gaining popularity with every passing day. Has it grown larger than some incumbents? Find out much more here as we bring you a close range comparison between Vue and React
Continue reading “Vue.js vs React.js: A Real Tight Comparison between the two”

8 things to learn in React before using Redux

  • A component can manage a whole lot of state, pass it down as props to its child components and pass a couple of functions along the way to enable child components to alter the state in the parent component again.
  • Component A is the only component that manages local state but passes it down to its child components as props.
  • In addition, it passes down the necessary functions to enable B and C to alter its own state in A.

    Now, half of the local state of component A is consumed as props by component C but not by component B.

  • When you lift the local state management down to component C, all the necessary props don’t need to traverse down the whole component tree.
  • When a library such as Redux “connects” its state managements layer with React’s view layer, you will often run into a higher order component that takes care of it (connect HOC in react-redux).

Facts about React that should be known before using Redux (or MobX). Most important: Learn React first, then opt-in Redux…
Continue reading “8 things to learn in React before using Redux”