Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuro

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
012345678901234567890123456789012345678901234567890123456789
Ieri
012345678901234567890123456789012345678901234567890123456789
Visualizzazioni totali
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di React
React
Getting Started with ReactProject StructureCore ConceptsData and StateTestingBuild and Deployment
Discussioni

Guida a React · 2/6

Project Structure

Per ora questo capitolo è disponibile solo in inglese.

This chapter walks through the folders and files generated by Vite's react-ts template, then covers configuration and folder layouts that hold up as a project grows.

The default layout

my-app/
├── public/
│   └── vite.svg
├── src/
│   ├── assets/
│   │   └── react.svg
│   ├── App.css
│   ├── App.tsx
│   ├── index.css
│   └── main.tsx
├── eslint.config.js
├── index.html
├── package.json
├── tsconfig.json
├── tsconfig.app.json
├── tsconfig.node.json
└── vite.config.ts
PathPurpose
index.htmlThe entry point. Vite starts here to find your scripts
src/main.tsxMounts React into the #root element of the HTML
src/App.tsxThe top-level component
src/assets/Images and fonts imported from code; built file names get a content hash
public/Files copied as-is (favicon, robots.txt and so on)
vite.config.tsVite configuration (plugins, path aliases, dev server)
tsconfig.*.jsonTypeScript settings split between app code (app) and config files (node)
eslint.config.jsESLint configuration, including the React hooks rules

index.html and main.tsx

Unlike many bundlers, Vite keeps index.html at the project root and treats it as the entry point. Starting from the src/main.tsx referenced by <script type="module">, it follows imports to load every module.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>my-app</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

main.tsx calls createRoot from react-dom/client to create a React root on the #root element and renders App into it. App-wide providers such as a router, a data-fetching client or a theme usually wrap the tree here as well.

import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.tsx";

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <App />
  </StrictMode>,
);
Domande su questo capitolo?
Capitolo precedenteGetting Started with ReactCapitolo successivoCore Concepts

package.json scripts

{
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  }
}

For speed, Vite only transpiles TypeScript and never type-checks it. That is why the build script runs tsc -b first and only calls vite build when there are no type errors. preview serves the build output locally so you can check it.

vite.config.ts and path aliases

To write @/components/Button instead of long relative paths like ../../components/Button, register the alias with both Vite and TypeScript.

import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
  },
  server: { port: 3000 },
});
{
  "compilerOptions": {
    "paths": { "@/*": ["./src/*"] }
  }
}

Add the paths entry to compilerOptions in tsconfig.app.json, which type-checks the app code. Using node:url in the config may require npm install -D @types/node.

Environment variables

Vite loads files such as .env, .env.local and .env.production from the project root. Only variables prefixed with VITE_ are exposed to client code, where you read them from import.meta.env.

# .env.local (keep this out of Git)
VITE_API_URL=http://localhost:8080
const apiUrl = import.meta.env.VITE_API_URL;
const isDev = import.meta.env.DEV;

These values are inlined into the bundle at build time, so anyone can read them. Never put secrets such as API keys into VITE_ variables; handle them on the server instead.

Organizing a growing project

React does not impose a folder structure. A small app is fine with a single src/components/; as it grows, grouping code by feature is a common approach.

  • src/components/: shared components used across screens, such as buttons and modals
  • src/features/<feature>/: the components, hooks and API calls that belong to one feature
  • src/hooks/: custom hooks shared between features, such as useDebounce.ts
  • src/lib/: UI-independent helpers and the API client
  • src/pages/ or src/routes/: page-level components when you use a router

By convention, component files use PascalCase names like UserCard.tsx and hooks start with use, as in useUser.ts. For styling you can import global CSS, use CSS Modules (Button.module.css) for locally scoped class names, or add a tool such as Tailwind CSS.

Summary

  • index.html is the entry point, and src/main.tsx mounts the React app into #root.
  • npm run build type-checks with tsc -b and then bundles with vite build.
  • Path aliases are registered in both vite.config.ts and tsconfig.app.json.
  • VITE_ environment variables are public, so never store secrets in them.
  • As the app grows, organize it by feature with consistent file naming.

0 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.