-
I'm having an error in my custom file when saving the Posts with Payload v3:
This is my component 'use client';
import type { TextFieldClientComponent } from 'payload'
import { useField } from '@payloadcms/ui'
export const CustomFieldTest: TextFieldClientComponent = ({ path }) => {
const { value, setValue } = useField<string>({ path })
return (
<div>
<p>{path}</p>
<input
onChange={(e) => { setValue(e.target.value) }}
value={value}
/>
</div>
)
}
export default CustomFieldTest This is how it is required in the collection form: fields: [
//...
{
name: 'body',
type: 'ui',
admin: {
components: {
Field: '@/collections/Posts/CustomFieldTest'
}
}
},
//...
] Sources: |
Beta Was this translation helpful? Give feedback.
Answered by
RPdvtPT
Nov 25, 2024
Replies: 1 comment
-
Solved, the field type was set to "UI", so it wasn't stored at the database, but the issue was the empty value in the RichText field |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RPdvtPT
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved, the field type was set to "UI", so it wasn't stored at the database, but the issue was the empty value in the RichText field