← @mortar-kit/core

BrickActionsinterface

import { BrickActions } from '@mortar-kit/core'

interface BrickActions

How the app connects brick forms to the server. Provide it with BrickActionsContext around the site; without it, a <ActionForm> renders but doesn't post anywhere.

Properties

action: (ref: EntryRef) => string | SerializableAttributeValue

The action attribute of an entry's form: the URL (or the router's form action) its post goes to.

useSubmission: (ref: () => EntryRef) => () => Submission<unknown> | undefined

The entry's latest submission, for its component. Called once per entry while rendering (hooks are fine); ref is an accessor because an entry can move to another document in the admin preview.

submit?: (ref: EntryRef, form: FormData) => void

Sends an entry's form in the background. When present, <ActionForm> stops the browser's own post and calls it; without it, the post goes to action(ref) (where a router may take it over). islandActions has it.