Create a new element with all child arrays transformed by a stateful function.
Like mapElementChildren, but the transform function also receives and returns
a state value. State is threaded sequentially through each child group: the output
state from one group becomes the input state for the next. This is useful when
the transformation needs to track information across sibling groups, such as
maintaining a monotonically increasing ID counter.
Create a new element with all child arrays transformed by a stateful function.
Like
mapElementChildren, but the transform function also receives and returns a state value. State is threaded sequentially through each child group: the output state from one group becomes the input state for the next. This is useful when the transformation needs to track information across sibling groups, such as maintaining a monotonically increasing ID counter.