Performance: What are props
MEDIUM IMPACT
Props affect how components receive data and can impact rendering performance when changed frequently or deeply nested.
function Parent() { const data = { name: 'Alice', age: 30 }; return <Child info={data} />; } function Child({ info }) { return <div>{info.name}</div>; }
function Parent() { const data = { name: 'Alice', age: 30 }; return <Child info={JSON.stringify(data)} />; } function Child({ info }) { const parsed = JSON.parse(info); return <div>{parsed.name}</div>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Passing serialized props | Extra JS parsing | Triggers re-render | Higher paint cost | [X] Bad |
| Passing direct props | Minimal JS work | Only necessary re-render | Lower paint cost | [OK] Good |