scrimba
Frontend Career Path
Advanced React
Reusability
Render Props Part 4 - children as render props
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Render Props Part 4 - children as render props
AboutCommentsNotes
Render Props Part 4 - children as render props
Expand for more info
App.js
run
preview
console
import React from "react"
import Decision from "./Decision"

function App() {
return (
<div>
<Decision render={(goingOut) => {
return (
<h1>
Am I going out tonight?? {goingOut ?
"Yes!" : "Nope..."}
</h1>
)
}} />
</div>
)
}

export default App
Console
/index.html
-2:11