From 424f0e81093b8bf6e98c79eea4f7bf645e9a8e2b Mon Sep 17 00:00:00 2001 From: rohankokane Date: Mon, 17 Aug 2026 14:43:19 +0530 Subject: [PATCH 1/2] fix(blade-mcp): define missing fetchers in TreeView async example The AsyncTree example called fetchCities() and fetchMoreCities() that were never defined, failing Knowledgebase Lint type-check (TS2552/TS2304) and turning master red. Add stubbed Promise fetchers. Co-authored-by: Cursor --- packages/blade-mcp/knowledgebase/components/TreeView.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/blade-mcp/knowledgebase/components/TreeView.md b/packages/blade-mcp/knowledgebase/components/TreeView.md index 9078b9bb76..58920e7742 100644 --- a/packages/blade-mcp/knowledgebase/components/TreeView.md +++ b/packages/blade-mcp/knowledgebase/components/TreeView.md @@ -293,6 +293,10 @@ function CityPicker() { import React from 'react'; import { TreeView, TreeViewItem, TreeViewLoadMore } from '@razorpay/blade/components'; +// Stubbed data fetchers - replace with your real API calls +const fetchCities = (): Promise => Promise.resolve(['Bengaluru', 'Mysuru']); +const fetchMoreCities = (): Promise => Promise.resolve(['Hubli', 'Mangaluru']); + function AsyncTree() { const [cities, setCities] = React.useState([]); const [isLoadingChildren, setIsLoadingChildren] = React.useState(false); From 53b1baae12af43683c5fd45dbc3e90dbc2ed6e68 Mon Sep 17 00:00:00 2001 From: "rzp-slash[bot]" Date: Mon, 17 Aug 2026 16:11:06 +0530 Subject: [PATCH 2/2] fix: guard against duplicate values on repeated Show more clicks [resolved by agent] Co-authored-by: admin --- .../knowledgebase/components/TreeView.md | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/blade-mcp/knowledgebase/components/TreeView.md b/packages/blade-mcp/knowledgebase/components/TreeView.md index 58920e7742..b79d6c819b 100644 --- a/packages/blade-mcp/knowledgebase/components/TreeView.md +++ b/packages/blade-mcp/knowledgebase/components/TreeView.md @@ -301,6 +301,7 @@ function AsyncTree() { const [cities, setCities] = React.useState([]); const [isLoadingChildren, setIsLoadingChildren] = React.useState(false); const [isLoadingMore, setIsLoadingMore] = React.useState(false); + const [hasMore, setHasMore] = React.useState(true); return ( @@ -322,16 +323,19 @@ function AsyncTree() { {cities.map((city) => ( ))} - { - setIsLoadingMore(true); - fetchMoreCities().then((moreCities) => { - setCities((previous) => [...previous, ...moreCities]); - setIsLoadingMore(false); - }); - }} - /> + {hasMore && ( + { + setIsLoadingMore(true); + fetchMoreCities().then((moreCities) => { + setCities((previous) => [...previous, ...moreCities]); + setIsLoadingMore(false); + setHasMore(false); + }); + }} + /> + )}