Closed samuelmale closed 1 month ago
Size Change: +85 B (+0.01%)
Total Size: 1.14 MB
So this enables us to effectively subscribe to form field update events:
const items = useMemo(() => {
// logic
return [];
}, [field.questionOptions.answers]);
return <>...
Requirements
Summary
Background: In the form-engine, state management is typically handled using a reducer pattern, often in conjunction with React's useReducer hook. This is propped with helpers to conveniently update the state eg. updateFormField.
Issue: The form-renderer currently receives the field object directly from the section instead of the reactive flattened form fields state. This obscures the cascade of the reactive events.
Solution: Treat the flattened
formFields
state as the source of truth.Screenshots
N/A
Related Issue
https://openmrs.atlassian.net/browse/O3-3908
Other