React Podcast cover image

118: Jenn Creighton on Composition and Architecture

React Podcast

00:00

Using Props in a Layout to Reuse UI Structures

The way that I have seen it most commonly used is when you want to reuse some UI structure that doesn't really take in any data. It's just kind of like your layout basically. So using it for like, oh, I have a layout with a sidebar, a header and a main like area. And I just want to pass in different components that will get rendered in those places because they need to be like a little bit different each time. But there's actually no harm in you creating separate like page components that will hold a sidebar,. A header and amain instead of passing in a component.

Play episode from 28:55
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app