Helpers

Props#

In the above components, the props were passed using spread syntax and inputProps / fieldProps methods. These functions essentially return objects that have all props for the given property and fieldConfig.

fieldProps#

fieldProps(field, fieldConfig);

Returns entry field props that can be passed to a Field. Automatically populates field type specific data. Expects fieldConfig as obtained from useFields hook.

<TextField {...fieldProps('name', fieldConfig)} />

inputProps#

inputProps(field, fieldConfig);

Returns entry field props that can be passed to an Input. Automatically populates input type specific data. Expects fieldConfig as obtained from useFields hook.

<TextInput {...inputProps('name', fieldConfig)} />