Description:
The fetchMentors useEffect hook in Frontend/src/pages/ExplorePage.jsx (approximately 80 lines) handles API requests, data transformation, skill aggregation, merging with mock data, and error handling all in one place. This leads to a monolithic block that's difficult to test, debug, and reuse, violating separation of concerns.
Proposed Solution:
Refactor into a custom hook useMentorsData that encapsulates fetching, transforming, and merging logic. Use utility functions for data transformation and skill collection to improve modularity.
Description:
The fetchMentors useEffect hook in Frontend/src/pages/ExplorePage.jsx (approximately 80 lines) handles API requests, data transformation, skill aggregation, merging with mock data, and error handling all in one place. This leads to a monolithic block that's difficult to test, debug, and reuse, violating separation of concerns.
Proposed Solution:
Refactor into a custom hook useMentorsData that encapsulates fetching, transforming, and merging logic. Use utility functions for data transformation and skill collection to improve modularity.