Conditional Rendering

In React, you can create distinct components that encapsulate behavior you need. Then, you can render only some of them, depending on the state of your application. Conditional rendering in React works the same way conditions work in JavaScript. Use JavaScript operators like if or the conditional operator to create elements representing the current state, and let React update… Continue reading Conditional Rendering

Published
Categorized as React

Handling Events

Handling events with React elements is very similar to handling events on DOM elements. There are some syntax differences: React events are named using camelCase, rather than lowercase. With JSX you pass a function as the event handler, rather than a string. For example, the HTML: is slightly different in React: Another difference is that… Continue reading Handling Events

State and Lifecycle

This page introduces the concept of state and lifecycle in a React component. You can find a detailed component API reference here. Consider the ticking clock example from one of the previous sections. In Rendering Elements, we have only learned one way to update the UI. We call root.render() to change the rendered output: In this section, we will learn… Continue reading State and Lifecycle

Published
Categorized as React

Components and Props

Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to the idea of components. You can find a detailed component API reference here. Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear… Continue reading Components and Props

Published
Categorized as React

Rendering Elements

Elements are the smallest building blocks of React apps. An element describes what you want to see on the screen: Unlike browser DOM elements, React elements are plain objects, and are cheap to create. React DOM takes care of updating the DOM to match the React elements. Rendering an Element into the DOM. Let’s say… Continue reading Rendering Elements

Published
Categorized as React

React JSX

React prefers developing with JSX files that loosely couples HTML and JS in the same file. You can put any valid JavaScript expression inside the curly braces in JSX. For example, 2 + 2, user.firstName, or formatName(user) are all valid JavaScript expressions. You can use JSX inside of if statements and for loops, assign it to variables, accept it as arguments, and return it from… Continue reading React JSX

Published
Categorized as React

Nx Nrwl Review

What is Nx? Nx is a Monorepo pattern and built by Nrwl. Is available through the Angular CLI. All Angular apps will live within the singular Angular Application Workspace. Why? Large Enterprise Apps, consistency, community standardization and patterns. Consider to be a robust why for developing applications. Setup Run the following command to create a… Continue reading Nx Nrwl Review

Create WordPress Child Theme

Create a new folder inside your theme directory. Naming the usual practice when creating a child theme is to give its folder the same name as the parent theme appended with -child. That way, anyone knows immediately that this is the child of an existing theme. Create the new style sheet. This is the file that… Continue reading Create WordPress Child Theme

Introduction to Node.js

Node.js is an open-source and cross-platform JavaScript runtime environment. It is a popular tool for almost any kind of project!