MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / ChallengesRedirect

Function ChallengesRedirect

client/src/pages/challenges/[...].tsx:15–24  ·  view source on GitHub ↗
({ params }: ChallengesRedirectProps)

Source from the content-addressed store, hash-verified

13}
14
15const ChallengesRedirect = ({ params }: ChallengesRedirectProps) => {
16 useEffect(() => {
17 const pathSegments = params['*'].split('/').filter(Boolean);
18 const [superBlock, block, challenge] = pathSegments;
19
20 void navigate(toLearnPath({ superBlock, block, challenge }));
21 }, [params]);
22
23 return null;
24};
25
26export default ChallengesRedirect;

Callers

nothing calls this directly

Calls 1

toLearnPathFunction · 0.85

Tested by

no test coverage detected