Performance: Props destructuring
LOW IMPACT
This affects the JavaScript execution speed and readability but has minimal direct impact on page load or rendering speed.
function Greeting({ name, surname }) { return <h1>Hello, {name} {surname}!</h1>; }
function Greeting(props) { return <h1>Hello, {props.name} {props.surname}!</h1>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Access props via props.name | 0 | 0 | 0 | [OK] Good |
| Destructure props in function parameters | 0 | 0 | 0 | [OK] Good |