Skip to content

Commit ed008ac

Browse files
committed
chore: faq on expanding/collapsing animations (#290)
1 parent f613976 commit ed008ac

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

packages/docs/docs/faq.mdx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ Feel free to contribute additional questions and answers if you think they are r
1818
updating items?</summary>
1919
<div>
2020

21-
If you want to react to tree state changes, I suggest you implement a custom
22-
[TreeDataProvider](https://rct.lukasbach.com/docs/api/interfaces/TreeDataProvider)
23-
rather than using
24-
StaticTreeDataProvider. There you can implement logic that reacts to change events. If you need more
21+
If you want to react to tree state changes, the easiest way to go forward is implementing a custom
22+
[TreeDataProvider](https://rct.lukasbach.com/docs/api/interfaces/TreeDataProvider),
23+
though it is also possible with static tree data providers.
24+
25+
[Here is some documentation on how to achieve this with static tree data providers](https://rct.lukasbach.com/docs/guides/static-data-provider),
26+
and [here is some documentation on how to do it with custom tree data providers](https://rct.lukasbach.com/docs/guides/custom-data-provider).
27+
28+
There you can implement logic that reacts to change events. If you need more
2529
control, you can also use a [controlled environment](https://rct.lukasbach.com/docs/guides/controlled-environment)
2630
rather than an uncontrolled environment, then you get complete control over your data.
2731

@@ -228,4 +232,14 @@ Reference: [#291](https://github.com/lukasbach/react-complex-tree/issues/291)
228232

229233
</details>
230234

235+
<details><summary>I want to animate expanding and collapsing subtrees</summary>
236+
237+
The library doesn't provide that functionality out of the box, but you can implement it yourself with some custom
238+
logic. [Here is a sample implementation](https://github.com/lukasbach/react-complex-tree/blob/7e4e397d464755002d8d09aa106c678e6598a803/packages/core/src/stories/BasicExamples.stories.tsx#L579),
239+
and [this is the storybook where you can see how it looks like](https://rct.lukasbach.com/storybook/?path=/story/core-basic-examples--animated-expanding-and-collapsing).
240+
241+
Reference: [#290](https://github.com/lukasbach/react-complex-tree/issues/290)
242+
243+
</details>
244+
231245
<!-- stopped at #147, next is #140 -->

0 commit comments

Comments
 (0)