Do you want a

```
invariant(childNode.previousSibling === beforeNode);
```

here?