Skip to content

Commit 787acf1

Browse files
committed
docs: faq (#291)
1 parent 93f7c19 commit 787acf1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/docs/docs/faq.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,14 @@ Reference: [#251](https://github.com/lukasbach/react-complex-tree/issues/251)
218218
</div>
219219
</details>
220220

221+
<details><summary>Render methods for tree items or others unnecessarily re-render</summary>
222+
223+
Yes, the render method for items are retriggered on tree state changes, since every item is provided with information about the tree state in their props, so tree items wouldn't be able to display data they otherwise can.
224+
225+
You can memoize the item render methods directly with only those props that you use, this will ensure that items are not rerendered unless they need to be: https://codesandbox.io/s/react-complex-tree-playground-memo-demo-37mngx
226+
227+
Reference: [#291](https://github.com/lukasbach/react-complex-tree/issues/291)
228+
229+
</details>
230+
221231
<!-- stopped at #147, next is #140 -->

0 commit comments

Comments
 (0)