- format long import statements with consistent line wrapping - apply consistent indentation across client and server modules - remove generated tsconfig.tsbuildinfo file
11 lines
280 B
TypeScript
11 lines
280 B
TypeScript
import { useContext } from 'react';
|
|
import { ToastContext, type ToastApi } from './toast-context';
|
|
|
|
export function useToast(): ToastApi {
|
|
const ctx = useContext(ToastContext);
|
|
if (!ctx) {
|
|
throw new Error('useToast must be used within ToastProvider');
|
|
}
|
|
return ctx;
|
|
}
|