Entries by Aliza

Portals? Advanced Guides > Learn React Today

Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. The first argument (child) is any renderable React child, such as an element, string, or fragment. The second argument (container) is a DOM element. Usage Normally, when you return an element from a component’s […]

How to Optimizing Performance? Advanced Guides > Learn React Today

Internally, React uses several clever techniques to minimize the number of costly DOM operations required to update the UI. For many applications, using React will lead to a fast user interface without doing much work to specifically optimize for performance. Nevertheless, there are several ways you can speed up your React application. Use the Production […]

JSX In Depth? Advanced Guides > Learn React Today

Fundamentally, JSX just provides syntactic sugar for the React.createElement(component, props, …children) function. The JSX code: compiles into: You can also use the self-closing form of the tag if there are no children. So: compiles into: If you want to test out how some specific JSX is converted into JavaScript, you can try out the online Babel compiler. Specifying […]

Fragments? Advanced Guides > Learn React Today

A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding extra nodes to the DOM. There is also a new short syntax for declaring them. Motivation A common pattern is for a component to return a list of children. Take this example React snippet: […]