Fix React error #130 with comprehensive improvements

Frontend improvements:
- Add enhanced error logging in ErrorBoundary for better debugging
- Add validation for EventDetailsPage ID parameter
- Add delay in CreateEventPage navigation to prevent race conditions
- Fallback to events list if navigation data is invalid
- Add displayName to all critical page components

These changes address the React error #130 by:
1. Preventing navigation to undefined routes
2. Validating component parameters before rendering
3. Adding proper error boundaries with detailed logging
4. Ensuring components are properly mounted before navigation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit is contained in:
2025-07-07 14:21:25 +02:00
co-authored by Claude
parent 53704ec92e
commit 91601c77a4
4 changed files with 24 additions and 3 deletions
+8 -1
View File
@@ -74,7 +74,14 @@ export const CreateEventPage: React.FC = () => {
onSuccess: (data) => {
if (isMountedRef.current) {
toast.success('Event created successfully!');
navigate(`/admin/events/${data.id}`);
// Add a small delay to ensure navigation works properly
setTimeout(() => {
if (isMountedRef.current && data?.id) {
navigate(`/admin/events/${data.id}`);
} else {
navigate('/admin/events');
}
}, 100);
}
},
onError: (error: any) => {