findField
Finds the field at a dot path in a field tree.
ts
const node = findField(nodes, path, options)Parameters
nodesreadonly FieldNode[]pathstringoptions{ placed?: boolean }: optional
Explanation
A path that names no field is a mistake in the code, so it throws a TypeError. With placed: true, so does a field of a list's items, which has no index outside its item and can't be rendered on its own: place the list instead.
Returns
nodeFieldNode