Render Props Pattern

Teaches the render props pattern for flexible component composition. Use when you need to share rendering logic between components by passing a function that returns JSX as a prop.

259 stars 28 forksFrontend & Design

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add PatternsDev/skills --skill render-props-pattern
Manual install
git clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/react/render-props-pattern ~/.claude/skills/render-props-pattern

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Render Props Pattern

## Table of Contents

- [When to Use](#when-to-use)
- [When NOT to Use](#when-not-to-use)
- [Instructions](#instructions)
- [Details](#details)
- [Source](#source)

Another way of making components very reusable, is by using the **render prop** pattern. A render prop is a prop on a component, which value is a function that returns a JSX element. The component itself does not render anything besides the render prop. Instead, the component simply calls the render prop, instead of implementing its own rendering logic.

Imagine that we have a `Title` component. In this case, the `Title` component shouldn't do anything besides rendering the value that we pass. We can use a render prop for this! Let's pass the value that we want the `Title` component to render to the `render` prop.

## When to Use

- Use this when you need to share stateful logic between components with different rendering needs
- This is helpful when the HOC pattern creates naming collision issues or overly deep nesting

## When NOT to Use

- When custom hooks can replace the pattern — hooks provide the same logic reuse without render prop nesting
- When it creates deeply nested JSX that becomes hard to read and maintain
- When the shared logic is simple enough for a plain utility function or hook

## Instructions

- Pass a function as a `render` prop (or `children` prop) that receives data and returns JSX
- Prefer custom Hooks over render props in most modern React code
Read the full skill on GitHub

Details

Skill name
render-props-pattern
Path
react/render-props-pattern/SKILL.md
Repo updated
15 April 2026

FAQ

What does the Render Props Pattern skill do?

Teaches the render props pattern for flexible component composition. Use when you need to share rendering logic between components by passing a function that returns JSX as a prop.

How do I install the Render Props Pattern skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add PatternsDev/skills --skill render-props-pattern. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Render Props Pattern popular?

It lives in PatternsDev/skills, which has 259 GitHub stars and 28 forks.

Related skills

Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.