When I use ScrollComponent.wrap() on a single layer it works. But, when I use it on a layer that has children it doesn't. (it also seems to collapse the wrapped layer in a strange way.) Why?
See without children: https://framer.cloud/qOmAnAnd with children: https://framer.cloud/AKrxo
The wrap function indeed checks whether the layer has children. If so, it replaces the content layer of the component provided layer. When there are no children it adds the layer to the existing content layer. This logic was added to ease turning Sketch imports into scrollable layers. If you want more control its better to set up the scroll component yourself. Just add the layer by setting its parent to scroll.content