Performance: Props drilling problem
MEDIUM IMPACT
This affects the rendering speed and responsiveness by increasing the number of component updates and re-renders due to passing props through many layers.
<Parent>
<Child1 />
</Parent>
// Use provide/inject or a global store to share data directly with Child3 without passing through Child1 and Child2<Parent> <Child1 :data="data"> <Child2 :data="data"> <Child3 :data="data" /> </Child2> </Child1> </Parent>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Props drilling through many components | Many components receive and pass props | Multiple reflows triggered by each re-render | High paint cost due to repeated updates | [X] Bad |
| Using provide/inject or global store | Only components that consume data update | Single or minimal reflows triggered | Lower paint cost due to fewer updates | [OK] Good |