Skip to main content

ItemMap Usage

There are three items in this questionnaire, therefore the itemMap Record<linkId, Omit<QuestionnaireItem, 'item'>> will have three items and their properties (excluding item.item).

This hook is useful for quickly accessing QuestionnaireItem properties via linkId without having to traverse the entire Questionnaire structure.

Live Editor
function App() {
  const itemMap = useQuestionnaireStore.use.itemMap();

  return (
    <>
      <YourBaseRendererWrapper questionnaire={qCalculatedExpressionBMICalculator} />
      <JsonViewer hookName="itemMap" data={itemMap} />
    </>
  );
}
Result
Loading...