You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the docs:
Therefore, the Server Component should have value. Nonetheless, the TextFieldServerComponent doesn't contain value type and is undefined.
Yeah, this seems to me to be a documentation issue more than a bug in ui, at least to me, to be honest. I say that because while value & initialValuearen't included in the default serverProps at this time, you get a few excellent workarounds. I think either value & initialValuemight be included at some point, or they've been omitted in favor of formState which has both properties and more.
In any case, you can use either of the data or formState props passed directly to your component to get the data you need to render your component properly.
I also noticed you're explicitly typing your props in your repro as any which isn't needed and would catch that value doesn't exist in the props. The TextFieldServerComponent is sufficient here.
Yeah, this seems to me to be a documentation issue more than a bug in ui, at least to me, to be honest. I say that because while value & initialValuearen't included in the default serverProps at this time, you get a few excellent workarounds. I think either value & initialValuemight be included at some point, or they've been omitted in favor of formState which has both properties and more.
Seems like the team wrote the docummentation based on what they wanted to do 😄
In any case, you can use either of the data or formState props passed directly to your component to get the data you need to render your component properly.
Yeah, but it should be done by Payload. Searching in a object based on path isn't elegant nor fit for end-user.
I also noticed you're explicitly typing your props in your repro as any which isn't needed and would catch that value doesn't exist in the props. The TextFieldServerComponent is sufficient here.
It's a reproduction bug ¯_(ツ)_/¯, TextFieldServerComponent doesn't contain value, thus I had to cast to any. Sometimes a property is not typed, but exists in runtime object.
Describe the Bug
Based on the docs:
Therefore, the Server Component should have
value
. Nonetheless, theTextFieldServerComponent
doesn't containvalue
type and isundefined
.Link to the code that reproduces this issue
https://github.com/GeorgeHulpoi/payload-custom-field-bug/tree/main
Reproduction Steps
abc
[the default value]).value: abc
, but it showsvalue:
Which area(s) are affected? (Select all that apply)
area: core, area: ui
Environment Info
The text was updated successfully, but these errors were encountered: