The Directorio UDC frontend is a React 19 + TypeScript single-page application built and served by Vite 8. React 19 provides the component model and state primitives, TypeScript adds static typing across the entire source tree, and Vite delivers sub-second cold starts and instant HMR during development. The React Compiler Babel preset is layered on top to automatically memoize components at build time, removing the need for manualDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Minogar28/DIRECTORIO_UDC/llms.txt
Use this file to discover all available pages before exploring further.
useMemo or useCallback calls in day-to-day development.
Entry Point
index.html is the single HTML shell Vite serves for every route. It boots the application with a module script tag:
index.html
main.tsx is the JavaScript entry point. It mounts the root React component into the #root div and wraps the entire tree in <StrictMode> to surface potential issues during development:
main.tsx
Component Structure
App.tsx is the root component and currently contains the main layout of the application. The layout is divided into two <section> elements:
#center— The hero section, rendered in the vertical and horizontal center of the viewport. It displays the hero image alongside the React and Vite logos and a live counter button wired to auseStatehook.#next-steps— A two-column information section split into a documentation panel (#docs) and a social links panel (#social).
.ticks dividers visually separate the sections, and a trailing #spacer section provides bottom whitespace.
App.tsx
CSS Theming
All visual tokens — colors, typography, shadows — are declared as CSS custom properties on the:root selector in index.css. This single source of truth makes it trivial to update the brand palette across the entire application by changing one value. Dark-mode overrides are applied automatically via the @media (prefers-color-scheme: dark) media query, so the app respects the user’s OS preference with no JavaScript involved.
index.css
App.css consume these variables (e.g. color: var(--accent), border: 1px solid var(--border)) so every UI element adapts automatically when the theme switches.
Vite Configuration
vite.config.ts registers two Vite plugins:
vite.config.ts
| Plugin | Purpose |
|---|---|
@vitejs/plugin-react | Enables JSX transform, Fast Refresh HMR, and React-specific optimizations. |
@rolldown/plugin-babel with reactCompilerPreset | Runs babel-plugin-react-compiler over every component at build time. |
React Compiler
The React Compiler (babel-plugin-react-compiler) is an ahead-of-time optimization that statically analyses component render functions and automatically inserts the equivalent of useMemo and useCallback at compile time. This means components only re-render when their actual inputs change, without any manual memoization boilerplate in the source code. The preset is applied via @rolldown/plugin-babel, Vite’s Rolldown-compatible Babel bridge.
TypeScript Configuration
tsconfig.app.json governs type-checking for all files under src/:
tsconfig.app.json
target: "es2023"— Output targets modern JavaScript, keeping the compiled output lean since legacy browser transforms are not required.jsx: "react-jsx"— Uses the React 17+ automatic JSX transform; noimport React from 'react'is needed in every file.moduleResolution: "bundler"— Resolves modules the same way Vite does, allowing bare specifiers and.tsxextension imports without friction.noUnusedLocals/noUnusedParameters— Enforce a clean codebase by turning unused declarations into compile errors.noEmit: true— TypeScript only type-checks; Vite handles the actual transpilation and bundling.