function assertContext(ctx: null | ModalCtx): asserts ctx is ModalCtx {
  if (!ctx) throw new Error('Modal context cannot be used outside of Modal component')
}