mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 10:27:49 +00:00
Fix ESLint fast-refresh warnings
Refactor to resolve react-refresh/only-export-components warnings: - Move buttonVariants export to separate file (Button.variants.ts) - Extract WebSocketContext to dedicated context file - Move useWebSocketContext hook to separate file - Update imports across affected files All component files now export only components, improving fast refresh reliability
This commit is contained in:
10
src/providers/useWebSocketContext.ts
Normal file
10
src/providers/useWebSocketContext.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useContext } from 'react';
|
||||
import { WebSocketContext } from './WebSocketContext';
|
||||
|
||||
export function useWebSocketContext() {
|
||||
const context = useContext(WebSocketContext);
|
||||
if (!context) {
|
||||
throw new Error('useWebSocketContext must be used within a WebSocketProvider');
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user