Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ComponentWrapper<DBSchema, StoreName, Value>

Type parameters

Hierarchy

  • ComponentWrapper

Index

Properties

Optional databaseMap

databaseMap: ComponentDatabaseMap<DBSchema, StoreName> | null

The properies needed to map the user-entered value for the wrapped component to the Database.

Optional defaultValue

defaultValue: Value | null

The optional default value to store in the Database if the component hasn't been changed by the user.

Optional emptyValue

emptyValue: Value | null

The value to consider as an empty input when updating the Database.

If ComponentWrapper.databaseMap is defined, then this will also be defined.

key

key: string

render

render: (props: ComponentWrapperRenderProps<DBSchema, StoreName, Value>) => Element

A function to render an instance of the component.

Type declaration

renderWhen

renderWhen: (stepValues: {}) => boolean

A callback to determine when the component should be rendered.

param

A map of the keys to the current values for all of the components in the currently rendered StepDefinition.

Type declaration

    • (stepValues: {}): boolean
    • Parameters

      Returns boolean

required

required: ((stepValues: {}) => boolean) | boolean

Whether or not to require an answer to this component if it is visible.

This will be ignored unless ComponentWrapper.databaseMap is defined.

Static propType

propType: Requireable<ComponentWrapper<NamedSchema<string, number, any>, string, any>> = PropTypes.exact({key: PropTypes.string.isRequired,render: PropTypes.func.isRequired,renderWhen: PropTypes.func.isRequired,databaseMap: PropTypes.instanceOf<ComponentDatabaseMap<// eslint-disable-next-line @typescript-eslint/no-explicit-anyNamedSchema<string, number, any>,string>>(ComponentDatabaseMap),defaultValue: PropTypes.any,emptyValue: PropTypes.any,required: PropTypes.oneOfType([PropTypes.func.isRequired,PropTypes.bool.isRequired,]).isRequired,})

The proptype validator for a ComponentWrapper.

Methods

Static wrapDynamic

Static wrapStatic

Generated using TypeDoc