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
'use client';import{RowLabelProps,useRowLabel,useField}from'@payloadcms/ui';exportconstRowLabel: React.FC<RowLabelProps>=()=>{const{ data, path }=useRowLabel();constvalue=useField({ path });constlabel=data.file;// have only the file id 677fd0a89d2010d16d18b47cconsole.log(value);// { path: 'file.0', value: undefined }return<div>{label}</div>;};
How can one get the file's name? I have only the id and not the value, also the useField hook return the value in the object as undefined.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have the following collection:
This is the RowLabel component:
How can one get the file's name? I have only the id and not the value, also the
useField
hook return the value in the object as undefined.Beta Was this translation helpful? Give feedback.
All reactions