2020-09-04
1421
#react#reference guide
Ovie Okeh
24391
Sep 4, 2020 â‹… 5 min read

React Reference Guide: Render props

Ovie Okeh Programming enthusiast, lover of all things that go beep.

Recent posts:

pure components in react using Using PureComponent and React.memo

Pure components in React: Using PureComponent and React.memo

Learn how to memoize components in React using React.PureComponent and the React.memo API, and cover the fundamentals of React components.

Glad Chinda
Mar 3, 2025 â‹… 7 min read
A guide to the CSS cursor property

A guide to the CSS cursor property

Learn about built-in CSS cursors, creating custom cursors with CSS, using multiple cursors, and adding animations with CSS and JavaScript.

Samson Omojola
Mar 3, 2025 â‹… 8 min read
Build A Custom React Native Turbo Module For Android

Build a custom React Native Turbo Module for Android

Build a React Native Turbo Module for Android to access device info like model, IP, uptime, and battery status using native mobile APIs.

Emmanuel John
Feb 27, 2025 â‹… 8 min read
how to measure round-trip time using cURL

How to measure round-trip time (RTT) using cURL

Learn how to measure round-trip time (RTT) using cURL, a helpful tool used to transfer data from or to a server.

David Omotayo
Feb 26, 2025 â‹… 10 min read
View all posts

One Reply to "React Reference Guide: Render props"

  1. The caveats section says that

    “`
    const DismissableContent = () => {
    const content = (dismiss) =>

    return (

    )
    }
    “`

    avoids extra re-renders compared to

    “`
    const DismissableContent = () => {
    return (
    } />
    )
    }
    “`

    but both variants still recreate the inline function on every re-render. What should work is one of the following:

    “`
    const content = (dismiss) =>
    const DismissableContent = () => {
    return (

    )
    }
    “`

    “`
    const DismissableContent = () => {
    const content = useCallback((dismiss) => , []);
    return (

    )
    }
    “`

Leave a Reply