no useCallbacks or useMemos

This commit is contained in:
2025-10-19 03:28:27 +01:00
parent 544581401b
commit 970bf22a6a
4 changed files with 11 additions and 7 deletions
+4 -1
View File
@@ -88,6 +88,7 @@ import { MazeRenderer } from './MazeRenderer';
- **Explicit returns**: Always return objects from hooks
- **Destructuring**: Use object destructuring for parameters and returns
- **Arrow functions**: Prefer arrow functions for consistency
- **No useCallback/useMemo**: React 19 optimization makes these hooks unnecessary
### Error Handling
- **Early returns**: Guard clauses at function start
@@ -176,6 +177,7 @@ export function useGame(options: GameOptions, platformHook?: unknown): GameManag
- Break existing patterns without reason
- Write overly complex implementations
- Add unnecessary features
- Use `useCallback` or `useMemo` anywhere in the codebase
### Always DO
- Follow existing code patterns exactly
@@ -183,4 +185,5 @@ export function useGame(options: GameOptions, platformHook?: unknown): GameManag
- Maintain type safety
- Keep implementations simple and focused
- Update documentation proactively
- Test builds after changes
- Test builds after changes
- Use plain functions instead of `useCallback`/`useMemo` (React 19 optimization)