currentPage
API / @publicodes/forms / currentPage
function currentPage<RuleName>(params): EvaluatedFormElement & FormPageElementProp[]
Defined in: form.ts:93
Creates a UI representation of the current form page.
Type Parameters
Type Parameter | Description |
---|---|
RuleName extends string | The existing rule names |
Parameters
Parameter | Type | Description |
---|---|---|
params | { engine : Engine <RuleName >; formState : FormState <RuleName >; } | - |
params.engine | Engine <RuleName > | The Publicodes engine instance |
params.formState | FormState <RuleName > | The current state of the form |
Returns
EvaluatedFormElement
& FormPageElementProp
[]
An array of form elements with their UI properties and validation state
Example
const pageElements = currentPage({ formState, engine })
// Returns array of FormElementInPage to be rendered