useField

useField(
   fieldId: string, 
   options?: FieldOptions, 
   deps? any[]): IFieldInfo | null | undefined;

Returns a field from web or list.

Examples

Get web field info,

const webFields = useField("5ee53613-bc0f-4b2a-9904-b21afd8431a7");

Get list field info,

const listFields = useField("MyCustomFieldInternalName", {
   list: "5ee53613-bc0f-4b2a-9904-b21afd8431a7"
});

Parameters

NameTypeDescriptionTracked for changes
fieldIdstringField internal name or IdYes
options?FieldOptionsuseField hook optionsPartially
deps?DependencyListHook dependency list.Yes