Hi! I tried to follow the Advanced: Trees example from the README, both in my project and directly in the test suite of this repo. Specifically this codeblock:
const node = schema.LoroMap({ name: schema.String({ required: true }) });
const s = schema({ tree: schema.LoroTree(node) });
const mirror = new Mirror({ doc: new LoroDoc(), schema: s });
mirror.setState((st) => {
st.tree.push({ data: { name: "root" }, children: [] });
});
When I add a unit test to run it (e.g. in schema-any.test.ts in this repo):
it("schema.LoroTree example from docs, Cannot read properties of undefined (reading 'push')", async () => {
const node = schema.LoroMap({
name: schema.String({ required: true }),
});
const s = schema({ tree: schema.LoroTree(node) });
const mirror = new Mirror({ doc: new LoroDoc(), schema: s });
mirror.setState((st) => {
st.tree.push({ data: { name: "root" }, children: [] });
});
});
I get an exception: TypeError: Cannot read properties of undefined (reading 'push')
I have not succeeded in using schema.LoroTree in my project. Would you please be able to help debug/fix this, and/or update the docs with a working example of how to use schema.LoroTree? Thank you!

Hi! I tried to follow the Advanced: Trees example from the
README, both in my project and directly in the test suite of this repo. Specifically this codeblock:When I add a unit test to run it (e.g. in
schema-any.test.tsin this repo):I get an exception:
TypeError: Cannot read properties of undefined (reading 'push')I have not succeeded in using
schema.LoroTreein my project. Would you please be able to help debug/fix this, and/or update the docs with a working example of how to useschema.LoroTree? Thank you!