hoist-static-jsx-elements

Hoist static JSX elements outside React components to prevent re-creation during renders.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/ihj04982/my-cursor-settings --skill hoist-static-jsx-elements
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hoist-static-jsx-elements
Source: https://github.com/ihj04982/my-cursor-settings/tree/main/skills/hoist-static-jsx-elements
Command: npx skills add https://github.com/ihj04982/my-cursor-settings --skill hoist-static-jsx-elements

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the performance issue in React applications where static JSX elements are unnecessarily recreated on every render, leading to performance degradation.

Core Features & Use Cases

  • Static Element Hoisting: Moves JSX elements that do not change between renders outside of the component function.
  • Performance Optimization: Reduces the overhead of re-creating expensive elements like large SVGs.
  • Use Case: Improve the rendering speed of components that frequently display static UI elements or complex SVG graphics.

Quick Start

Apply the hoist-static-jsx-elements skill to the provided React code.

Frequently Asked Questions about hoist-static-jsx-elements

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize React rendering performance for static JSX elements?

To optimize React rendering for static JSX elements, you can hoist unchanging elements outside the component function. This prevents React from unnecessarily re-creating the same static elements during each render cycle.

Why does React re-create large SVGs on every render and how can I prevent it?

React re-creates large SVGs on every render because they are typically defined inside the component function. You can prevent this performance overhead by hoisting the static SVG JSX elements outside of the component.

What is the best way to stop unnecessary re-creation of static UI elements in React?

The best way to stop unnecessary re-creation of static UI elements in React is manual hoisting. By moving static JSX outside the component function, you eliminate the overhead of regenerating unchanged elements during re-renders.

Does manual JSX hoisting work better than the React Compiler for optimization?

Manual JSX hoisting does not outperform the React Compiler for optimization. This manual performance technique of moving static elements outside components is actually superseded by the automated React Compiler.

When should I hoist static JSX elements outside of a React component?

You should hoist static JSX elements outside a React component when dealing with unchanging UI elements that cause performance degradation. It is particularly beneficial for optimizing components that frequently display complex SVG graphics.