Type Alias: FormulaFormProps<T, S, F>
FormulaFormProps<
T,S,F> =FormProps<T,S,F> &object
Defined in: FormulaForm.tsx:17
Props accepted by FormulaForm.
Extends all standard RJSF FormProps with formula-specific configuration. All formula-specific props are optional except evaluator.
Type Declaration
debounceMs?
optionaldebounceMs?:number
Milliseconds to debounce formula evaluation after a user input event. Defaults to 300. Set to 0 to disable the debounce delay and evaluate on the next event loop tick.
evaluator
evaluator: (
formula,context) =>unknown|Promise<unknown>
Evaluates a formula string against a context object and returns the computed value.
Parameters
formula
string
The formula string from the schema.
context
object
Sibling field values, or full form data in extended mode.
Returns
unknown | Promise<unknown>
The computed value, or a Promise resolving to it.
Remarks
May return a plain value or a Promise. For user-supplied formulas, do not use eval — it allows arbitrary code execution. Prefer a sandboxed evaluator such as expr-eval or mathjs. For additional isolation, run the evaluator in a Web Worker.
Form?
optionalForm?:React.ComponentType<FormProps<T,S,F>>
Inner RJSF Form component to render. Defaults to Form from @rjsf/core. Swap to use a themed form (e.g. Form from @rjsf/bootstrap-4).
formulaConflictBehavior?
optionalformulaConflictBehavior?:"ignore"|"warn"|"error"
What to do when multiple branches of a composition operator (allOf at schema-analysis time, or simultaneously-active oneOf/anyOf branches at evaluation time) define a formula for the same field path.
'ignore'— silently take the last definition.'warn'(default) — emitconsole.warnand take the last definition.'error'— throw aTypeErrorsynchronously (useful during development).
formulaContextKey?
optionalformulaContextKey?:string
Schema key that selects the context mode for a field. Defaults to 'x-formula-context'.
formulaDataKey?
optionalformulaDataKey?:string
Key injected into the extended context carrying the full form data. Defaults to '__formData__'. Override if a sibling field uses the same name.
formulaKey?
optionalformulaKey?:string
Schema key that marks a field as computed. Defaults to 'x-formula'.
formulaPathKey?
optionalformulaPathKey?:string
Key injected into the extended context carrying the field's resolved path. Defaults to '__path__'. Override if a sibling field uses the same name.
maxConvergencePasses?
optionalmaxConvergencePasses?:number
Maximum number of re-evaluation passes triggered by a single input event. Guards against infinite loops from circular formula dependencies. Defaults to 10.
onFormulaError?
optionalonFormulaError?: (path,error) =>void
Called when a formula throws during evaluation.
Parameters
path
(string | number)[]
JSON path of the field whose formula failed.
error
Error
The error thrown by the evaluator.
Returns
void
onLoadingChange?
optionalonLoadingChange?: (loadingPaths) =>void
Called whenever the set of currently-evaluating fields changes. Useful for showing per-field loading indicators.
Parameters
loadingPaths
(string | number)[][]
Paths of all fields whose evaluations are in progress.
Returns
void
Type Parameters
T
T = any
S
S extends StrictRJSFSchema = RJSFSchema
F
F extends FormContextType = any