# Custom Field Factory

Now things begins to be fun, and closer to the real word! After all, you need to display errors and other thinks that your user needs.

```jsx
// myFieldFactory.tsx
// ------------------

// Some extra fprops
interface MyFieldFactoryProps {
    fLabel?: string
}

// Your awesome factory, with error displaying, label and requirement showing
function MyFieldFactory<TProps>(field: FieldFactoryArgs<TProps>) {
    return FieldFactory<TProps, MyFieldFactoryProps>((fprops, props, fieldBindings, fielStatus) => 
            <div>
                <div>
                    {fprops.fLabel}
                    {fprops.fRequired && "*"}
                </div>
                <div>
                    {field(fprops, props, fieldBindings, fielStatus)}
                </div>
                <div>
                    {fielStatus.shouldDisplayErrors && fielStatus.errors}
                </div>
            </div>
        )

}
```

Now, just use your factory on your components!

```jsx
// componentField.tsx
// --------------

// Use it!
const ComponentField = MyFieldFactory<ComponentProps>((fprops, props, fieldBindings, fielStatus) => 
    <Component {...props} {...fieldBindings} />
)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://luisgustavolf.gitbook.io/react-satisfying-forms/quick-start/custom-field-factory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
