mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
16 lines
488 B
TypeScript
16 lines
488 B
TypeScript
import { useContext } from 'react';
|
|
import { ConsoleErrorContext } from '@/contexts/ConsoleErrorContext';
|
|
|
|
/**
|
|
* Hook to access console error state from the ConsoleErrorProvider.
|
|
* Provides boolean error state and console error information for Quilly.
|
|
*/
|
|
export function useConsoleError() {
|
|
const context = useContext(ConsoleErrorContext);
|
|
|
|
if (context === undefined) {
|
|
throw new Error('useConsoleError must be used within a ConsoleErrorProvider');
|
|
}
|
|
|
|
return context;
|
|
} |