Skip to content
Closed
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
17 changes: 17 additions & 0 deletions docs/admin/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,20 @@ The `condition` function should return a boolean that will control if the field
]
}
```

<Banner type="warning">
<strong>Note:</strong>
When using [Custom Field Components](#field-components) and `condition` together, you need to wrap them with the `withCondition` HOC.
Example:
```tsx
'use client'
import { withCondition } from '@payloadcms/ui'
import React from 'react'

const Component: TextFieldClientComponent = ({ field }) => {
return <input placeholder="custom component" name={field.name} />
}

export const CustomTextFieldClient = withCondition(Component)
```
</Banner>