Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/hooks/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ membership level (Standard, Premium, VIP). The hook monitors changes in the memb
logs the update and can be used to trigger further actions, such as tracking conversion from one tier to another or
notifying them about changes in their membership benefits.

<Banner type="success">
**NOTE:** `beforeChange` and `afterChange` hooks only run after validation has
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently not true for beforeChange - beforeChange field hooks run before validation.

This is unintuitive and should be changed in payload - see this issue for more context: https://linear.app/figma-trial/issue/PAYL-78/run-beforechange-hooks-after-validation

passed and the document is successfully saved. If validation fails, these
hooks will not be triggered. Use field-level validate for logic that should
run on invalid input.
</Banner>

### afterRead

The `afterRead` hook is invoked after a field value is read from the database. This is ideal for formatting or
Expand Down