{
    "url": "https://delaparra-services.nl/manuals/een-react-project-starten",
    "locale": "en",
    "title": "Getting started with a React project · DeLaParra Services",
    "description": "Creating a React project with Vite, understanding the directory structure and building the app for the live site.",
    "alternates": {
        "en": "https://delaparra-services.nl/manuals/een-react-project-starten",
        "nl": "https://delaparra-services.nl/nl/handleidingen/een-react-project-starten"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/manuals/een-react-project-starten.csv",
        "md": "https://delaparra-services.nl/manuals/een-react-project-starten.md",
        "json": "https://delaparra-services.nl/manuals/een-react-project-starten.json",
        "zip": "https://delaparra-services.nl/manuals/een-react-project-starten.zip",
        "pdf": "https://delaparra-services.nl/manuals/een-react-project-starten.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/manuals/een-react-project-starten.csv",
            "encodingFormat": "text/csv",
            "name": "een-react-project-starten.csv"
        },
        {
            "url": "https://delaparra-services.nl/manuals/een-react-project-starten.json",
            "encodingFormat": "application/json",
            "name": "een-react-project-starten.json"
        },
        {
            "url": "https://delaparra-services.nl/manuals/een-react-project-starten.md",
            "encodingFormat": "text/markdown",
            "name": "een-react-project-starten.md"
        },
        {
            "url": "https://delaparra-services.nl/manuals/een-react-project-starten.pdf",
            "encodingFormat": "application/pdf",
            "name": "een-react-project-starten.pdf"
        },
        {
            "url": "https://delaparra-services.nl/manuals/een-react-project-starten.zip",
            "encodingFormat": "application/zip",
            "name": "een-react-project-starten.zip"
        }
    ],
    "markdown": "Creating a React project with Vite, understanding the directory structure and building the app for the live site.\n\n## WHAT IT IS | Building blocks for your screen.\n\nReact is a JavaScript library from Meta for building screens from individual components, such as a button, a menu or a form. With **Vite**, you can set up a new React project in just a few minutes.\n\n### 01 / Creating a new project\n\nOpen the terminal in the folder where you store your projects:\n\n```\nnpm create vite@latest mijn-app -- --template react-ts\n```\n\n`react-ts` creates a project using TypeScript. Would you prefer plain JavaScript? If so, use `--template react`.\n\n### 02 / Installation and start-up\n\n```\ncd mijn-app\nnpm install\nnpm run dev\n```\n\nOpen the address that appears, usually http://localhost:5173.. To stop the process, press **Ctrl + C**.\n\n## THE FOLDERS | What’s where.\n\n### 03 / The most important files\n\n01. **index.html**: the only HTML page. React populates it.\n02. **src/main.tsx**: this is where the app starts.\n03. **src/App.tsx**: the first section. Edit the text and save; you’ll see the changes straight away in the browser.\n04. **public/**: images and files that will be published online exactly as they are.\n05. **package.json**: the list of packages and commands.\n\n### 04 / A component\n\nA component is a function that returns a section of the screen:\n\n```\nfunction Welkom() {\n  return <h1>Welkom op mijn app</h1>;\n}\n```\n\nYou then use it as `<Welkom />`.\n\n## PUT ONLINE | Build the app.\n\n### 05 / Construction\n\n```\nnpm run build\n```\n\nVite places the finished files in the `dist` folder. You then upload that folder to your hosting account.\n\n### 06 / View locally first\n\n```\nnpm run preview\n```\n\n### 07 / Committing to Git\n\nVite automatically creates a `.gitignore` file containing `node_modules` and `dist`. Add the rest of the project to Git. See the ‘Working with Git’ manual.\n\n## WORKING WITH AI | Ask your assistant.\n\n### 08 / Documentation\n\nThe official documentation can be found on react.dev and vite.dev. Ask your AI assistant to use these instead of outdated examples. Many examples online still use Create React App, which is no longer maintained.\n\n### 09 / A task for your AI assistant\n\n\"In this React project, create a contact form with fields for name, email and message. Use the documentation from react.dev. Show which files you are modifying and ask for permission before installing new packages.\"\n\n**Good to know**\nAny visitor can read everything contained within a React app. Never include API keys or passwords there, not even in a file beginning with `VITE_`.\n\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "TechArticle",
                "@id": "https://delaparra-services.nl/manuals/een-react-project-starten#article",
                "url": "https://delaparra-services.nl/manuals/een-react-project-starten",
                "headline": "Getting started with a React project",
                "description": "Creating a React project with Vite, understanding the directory structure and building the app for the live site.",
                "inLanguage": "en",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/manuals/een-react-project-starten#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/manuals/een-react-project-starten#dataset",
                "name": "Getting started with a React project",
                "description": "Creating a React project with Vite, understanding the directory structure and building the app for the live site.",
                "url": "https://delaparra-services.nl/manuals/een-react-project-starten",
                "identifier": "https://delaparra-services.nl/manuals/een-react-project-starten#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/manuals/een-react-project-starten#article"
                },
                "publisher": {
                    "@type": "Organization",
                    "name": "DeLaParra Services",
                    "url": "https://delaparra-services.nl/"
                },
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/manuals#dataset",
                    "name": "Manuals for working on your own app",
                    "url": "https://delaparra-services.nl/manuals"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "een-react-project-starten.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/manuals/een-react-project-starten.csv",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "een-react-project-starten.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/manuals/een-react-project-starten.json",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "een-react-project-starten.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/manuals/een-react-project-starten.md",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "een-react-project-starten.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/manuals/een-react-project-starten.pdf",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "een-react-project-starten.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/manuals/een-react-project-starten.zip",
                        "inLanguage": "en"
                    }
                ]
            }
        ]
    }
}