core
core copied to clipboard
What should I do if I want to watch the entire subtree?
In the current documentations of useDocs, there is a mention that it watches the tree up to a given depth. Is there any way we can watch the entire subtree?
By "watches", we mean it rerenders the React component where you use useDoc hook, whenever the updates occur until the given depth. Explained in detail here.
If you want to subscribe your component to updates on the whole tree, you can do this
useDoc("", Infinity)
This is not recommended though.
If you just want to observe changes somewhere, not necessarily a React component, you can use observe with depth Infinity
.