Step 3: USE_FUNCTION Frontend
To display the stock price on the Search frontend, we use the code here in Search Headless React.
To access this data in Search Headless, you would do this:
const queryRulesData = useAnswersState((s) => s.queryRules.actions);
const stockData = queryRulesData.find(
(item) => item.key === "stockData"
) as any as StockData | undefined;
Feedback
<% elem.innerText %>