Closed jameswong3388 closed 1 year ago
I followed the example given in the docs, but it does not seem like returning anything tho. Did I make anymistakes ?
function CurrentActions() { const { actionAncestors } = useKBar((state) => { let actionAncestors = [] const collectAncestors = (actionId) => { const action = state.actions[actionId] if (!action.parent) { return null } actionAncestors.unshift(action) const parent = state.actions[action.parent] collectAncestors(parent) } return { actionAncestors, } }) return ( <div className="flex flex-wrap items-center bg-white px-4 pt-4 text-xs text-gray-700"> <button className="rounded bg-zinc-100 px-1">home</button> {actionAncestors.map((action) => ( <button key={action}>{action}</button> ))} </div> ) }
I followed the example given in the docs, but it does not seem like returning anything tho. Did I make anymistakes ?