Skip to content

Commit 897dd4e

Browse files
author
rzp-slash[bot]
committed
fix: auto-heal PR via Slash PR Healer
- Add missing return type on TestComponent in Toast.native.test.tsx (fixes @typescript-eslint/explicit-function-return-type lint error) - Add changeset for useToastActions() feature (minor bump for @razorpay/blade, @razorpay/blade-svelte, @razorpay/blade-mcp)
1 parent 9af8ebe commit 897dd4e

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@razorpay/blade": minor
3+
"@razorpay/blade-svelte": minor
4+
"@razorpay/blade-mcp": minor
5+
---
6+
7+
feat(Toast): add useToastActions() hook with referentially-stable show/dismiss decoupled from toast-state subscription
8+
9+
Introduces a new `useToastActions()` hook across React Web, React Native, and Svelte that returns stable `show` and `dismiss` functions without subscribing to the toast-state store. Components using this hook will NOT re-render when toasts are shown or dismissed. `useToast()` remains backward compatible but now also returns stable `show`/`dismiss` references.

packages/blade/src/components/Toast/__tests__/Toast.native.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('useToastActions (native)', () => {
122122

123123
it('does not subscribe to toast-state changes (no re-render on show)', () => {
124124
let renderCount = 0;
125-
const TestComponent = () => {
125+
const TestComponent = (): React.ReactElement | null => {
126126
renderCount++;
127127
useToastActions();
128128
return null;

0 commit comments

Comments
 (0)