rendering-hoist-jsx

Hoist Static JSX Elements

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rendering-hoist-jsx" with this command: npx skills add theorcdev/8bitcn-ui/theorcdev-8bitcn-ui-rendering-hoist-jsx

Hoist Static JSX Elements

Extract static JSX outside components to avoid re-creation.

Incorrect (recreates element every render):

function LoadingSkeleton() { return <div className="animate-pulse h-20 bg-gray-200" /> }

function Container() { return ( <div> {loading && <LoadingSkeleton />} </div> ) }

Correct (reuses same element):

const loadingSkeleton = ( <div className="animate-pulse h-20 bg-gray-200" /> )

function Container() { return ( <div> {loading && loadingSkeleton} </div> ) }

This is especially helpful for large and static SVG nodes, which can be expensive to recreate on every render.

Note: If your project has React Compiler enabled, the compiler automatically hoists static JSX elements and optimizes component re-renders, making manual hoisting unnecessary.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

fumadocs-mdx-structure

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

rendering-animate-svg

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

8-bit-pixel-art-patterns

No summary provided by upstream source.

Repository SourceNeeds Review