Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DynamicComponentOptions<Props, DBSchema, StoreName, Value>

The options for DynamicComponent.

Type parameters

Hierarchy

  • DynamicComponentOptions

Index

Properties

Component

Component: DynamicComponentType<Props, Value>

The component class or function to render.

The component must implement DynamicComponentControlledProps in addition to any of its own props.

Pass static prop values via DynamicComponentOptions.props.

databaseMap

databaseMap: ComponentDatabaseMap<DBSchema, StoreName>

The configuration telling the DynamicComponent how to interface with the Database.

See ComponentDatabaseMap for more details.

defaultValue

defaultValue: Value | undefined

The value to default to when nothing exists in the provided database store.

If this is undefined, it will use whatever the default value for the component is.

emptyValue

emptyValue: Value

The value representing an empty value for this component.

In order for React to manage a controlled component, the controlled prop must always be defined.

key

key: string

A unique identifier for this component.

props

props: Props

The static props to pass to DynamicComponentOptions.Component.

These should not include the DynamicComponentControlledProps, which are injected automatically.

Optional required

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

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

Methods

Optional renderWhen

  • renderWhen(stepValues: {}): boolean
  • A callback to determine when the component should be rendered.

    If this is not specified, the component will always be rendered.

    const renderWhen = values => values["my-radio-buttons"] === "Yes"

    Parameters

    • stepValues: {}

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

    Returns boolean

Generated using TypeDoc