Sintassi del Primo Programma - React Tutorial Italiano 04

Edoardo Midali
11 Nov 202312:32

Summary

TLDRThe transcript discusses the structure of a React project, emphasizing the syntax and file organization within the framework. It explains the role of the Index HTML as the entry point, the use of JSX, and the importance of the 'root' element for React applications. The video highlights the transition from traditional HTML, CSS, and JavaScript to the React ecosystem, where components and state management play a central role. It also mentions the use of CSS for styling and the distinction between global styles in Index CSS and component-specific styles in App CSS.

Takeaways

  • 📜 The script is from episode 4 of a React course, focusing on the structure of a React project and the syntax of React.
  • 🌐 The 'Source' folder contains important files, but the discussion is not delved into immediately due to the need to understand React's syntax first.
  • 🔄 The script emphasizes the initial confusion that comes with learning any new framework, especially when transitioning from a traditional HTML, CSS, and JavaScript mindset.
  • 🏁 The 'Index HTML' serves as the entry point of the website, which is akin to the 'home' page when visiting a site like 'cg.com'.
  • 📦 The body of the 'Index HTML' is initially empty, with the content being injected later through 'main.jsx', illustrating the concept of 'hydration' in React.
  • 🌳 The script introduces the concept of 'root', a unique identifier used by React to establish the root of the application.
  • 📚 'main.jsx' is highlighted as a crucial file that imports necessary packages like 'react' and 'react-dom', and it's where the React application starts rendering its components.
  • 🔧 The script explains the use of 'document Object Model (DOM)' in dynamically adding elements to the HTML with JavaScript, which is fundamental in React's operation.
  • 🛠️ The 'app.jsx' file is mentioned as a key component that is imported and rendered within 'main.jsx', showing how React uses JavaScript functions to create HTML elements.
  • 🎨 The importance of CSS in styling the React application is discussed, with 'index.css' and 'app.css' being used to style the overall page and the 'App' component respectively.
  • 🔄 The script concludes by encouraging learners to understand the basics well, as it forms a strong foundation for more complex topics to be covered later in the course.

Q & A

  • What is the main topic of the script?

    -The main topic of the script is an introduction to the structure of a React project, focusing on the syntax of React and how it functions within various files.

  • What does the script mention about the initial experience with frameworks like React?

    -The script mentions that frameworks like React can be confusing at first, especially for those who are used to working with a more direct approach of HTML, CSS, and JavaScript.

  • What role does the Index HTML file play in a React project?

    -The Index HTML file serves as the entry point of a React project. It is the first page loaded when visiting the website, and it typically contains an empty element where the React content is injected.

  • How does the script describe the use of the 'main.jsx' file?

    -The 'main.jsx' file is described as a crucial component that is read after the Index HTML file. It contains the code that injects the React content into the empty element in the Index HTML, effectively starting the React application.

  • What is the significance of the 'root' element in React?

    -The 'root' element is significant in React as it represents the base of the application. It is a unique identifier that allows React to manage the rendering of components within the application.

  • What is the purpose of the 'strictMode' element in React?

    -The 'strictMode' element in React is used during development to provide more detailed error messages and warnings. It helps developers identify potential issues in their code, but it is not included in the production build.

  • How does the script explain the use of 'app.jsx' and 'app.css' in the project structure?

    -The script explains that 'app.jsx' is a component file that is imported into the 'main.jsx' file. 'app.css' is the stylesheet associated with the 'app.jsx' component, controlling the visual appearance of the application.

  • What is the relationship between CSS and React components as described in the script?

    -The script describes that CSS files are often named after their corresponding React components to maintain a clear relationship. The 'app.css' file specifically styles the 'app' component, while 'index.css' styles the overall page structure.

  • How does the script address the concept of components in React?

    -The script introduces the concept of components in React as functions that return HTML. It emphasizes that React components are not classes but rather functions that can be imported and used to build the structure of the application.

  • What advice does the script give for learning React?

    -The script advises learners to be patient and to take the time to understand the foundational concepts of React. It also recommends a masterclass for advanced learning, emphasizing the importance of understanding the different approach that React requires compared to traditional web development.

  • What is the significance of the 'public' folder in the React project structure?

    -The 'public' folder is significant as it is where static assets such as the favicon and logos are stored. The Index HTML file directly accesses these assets from the 'public' folder, and they are served when the application is run.

Outlines

00:00

🚀 Introduction to React Project Structure and Syntax

This paragraph introduces the structure of a React project, emphasizing the importance of understanding the syntax and how it functions within various files. It explains that the initial learning curve can be confusing due to the shift from traditional HTML, CSS, and JavaScript workflows to the React framework. The discussion begins with the Index HTML file, which serves as the entry point of the website. It clarifies that despite the seemingly empty body of the Index HTML, the content is dynamically loaded through the main.jsx file. The explanation touches on the unique ID 'root' and its role as the base for the entire application. It also mentions the use of JSX, a version of JavaScript, to inject content into the page once it has loaded.

05:02

🌟 Understanding React's Root Element and Component Creation

This section delves deeper into how React creates its own 'root' element and uses it to build the application. It explains that React uses 'document.getElementById' to find the root element and starts the rendering process. The paragraph introduces the concept of 'strict mode' for development purposes, which aids in identifying errors and warnings. It also discusses the 'app' element, imported from 'App.jsx', and clarifies that React components are functions, not classes. The summary highlights how React translates what appears to be HTML into JavaScript, ultimately rendering it to the screen. It also touches on the separation of concerns between the 'Index' and 'App' CSS files, explaining how they control the styling of the page and the 'App' component, respectively.

10:03

🎨 Styling in React and Component-Specific CSS

This paragraph focuses on the role of CSS in a React application and how it is structured. It explains the importance of importing the 'app.css' file to style the 'App' component and how removing this file affects the page's appearance. The discussion highlights the difference between 'Index.css', which styles the entire page, and component-specific CSS files, which style individual components. The summary demonstrates how changing the background color in 'Index.css' affects the entire page, while changing it in 'App.css' only affects the 'App' component. It concludes by emphasizing the foundational nature of the content covered and encourages learners to be proud of their progress, as they have acquired enough knowledge to start building a complete project.

Mindmap

Keywords

💡React

React is an open-source JavaScript library used for building user interfaces, particularly single-page applications. It allows developers to create reusable UI components and manage the state of the application efficiently. In the video, React is the central technology around which the course is built, and the speaker discusses its syntax and how it functions within various files of a React project.

💡Project Structure

Project structure refers to the organization of files and folders within a software project. In the context of the video, the speaker is discussing the specific layout of a React project, including the 'Source' directory and the significance of the 'Index.html' file as the entry point of the website. Understanding project structure is crucial for navigating and maintaining a React application effectively.

💡Syntax

Syntax in programming refers to the set of rules that dictate how code should be written. In the video, the speaker mentions the need to discuss React's syntax, emphasizing that it can be confusing at first, especially for those coming from a traditional HTML, CSS, and JavaScript background. The syntax defines how React components and elements are structured and interact with each other.

💡Index.html

The 'Index.html' file is the default entry point for web pages. In the video, it is highlighted as the starting point of a website where the first page is served. In a React project, the 'Index.html' file contains an empty 'div' element with the ID 'root', which serves as the mounting point for the React application. The speaker emphasizes the importance of understanding how React utilizes this file to inject content after the page has loaded.

💡JSX

JSX, or JavaScript XML, is a syntax extension for JavaScript that allows developers to write HTML-like code within JavaScript files. This is particularly useful in React, as it enables the creation of React elements that can be rendered to the DOM. In the video, the speaker discusses how JSX is used to import 'react' and 'react-dom' and how it translates to standard HTML and JavaScript operations, making it easier to create and manage UI components.

💡Components

In React, a component is a piece of code that encapsulates a part of the UI, managing its own state and rendering HTML based on that state. Components can be thought of as building blocks for the user interface. The video touches on the concept of components, explaining that they are functions that return HTML to be rendered on the page. The speaker also mentions 'App.js' as an example of a component, which is responsible for the main content of the application.

💡State

State in React refers to a plain JavaScript object that represents the data that can change over time and influence the rendering of the component. The speaker mentions state in passing, indicating that it is a fundamental concept in React for creating dynamic and interactive user interfaces. Understanding state management is crucial for responding to user input and updating the UI accordingly.

💡Strict Mode

React Strict Mode is a tool that helps developers identify potential problems in a non-production environment. It does not affect the production build, but it provides more detailed warnings and errors during development. In the video, the speaker explains that 'Strict Mode' is used within the 'App' component to enhance debugging and error detection, which is essential for developing robust React applications.

💡Public Folder

In a React project, the 'public' folder is a special directory where you can put static assets like images, logos, and other files that need to be accessible directly by the web server. The speaker mentions the 'public' folder in relation to the placement of the 'favicon' and other assets like the logos of 'Vite' and 'React', which are used in the 'Index.html' file. This folder is crucial for serving static resources that are part of the application's UI.

💡CSS

CSS, or Cascading Style Sheets, is a stylesheet language used for describing the presentation of a document written in HTML. In the video, the speaker discusses the importance of CSS for styling the React application, including the 'App.css' file that controls the appearance of the 'App' component and the 'Index.css' file that styles the entire page. Understanding how to use CSS with React is essential for creating visually appealing and well-structured user interfaces.

💡DOM (Document Object Model)

The DOM is a programming interface for HTML and XML documents. It represents the structure of a document in a tree-like form, allowing developers to manipulate the document's content and structure using JavaScript. In the video, the speaker explains how React uses the DOM API to dynamically create and update elements in the webpage, which is a core concept for building interactive applications with React.

Highlights

The introduction to the structure of a React project is discussed, emphasizing the importance of understanding the syntax and file organization.

The concept of the Index HTML file as the entry point of a website is explained, highlighting its role when visiting a site like cg.com.

The unique role of the 'root' div is described, serving as the base for the entire React application and its necessity for the app to function.

The process of injecting content into the empty 'root' element using main.jsx is detailed, illustrating the dynamic loading of the application's content.

The importance of the 'react' and 'react-dom' packages is discussed, explaining their necessity for creating and managing the React application's DOM elements.

The use of 'app.jsx' is introduced, explaining how it contains the HTML content within a function's return statement, which is then rendered on the screen.

The distinction between 'app' and 'Index' is clarified, with 'Index' serving as the starting point and 'app' being the actual content displayed to the user.

The role of CSS in styling the React application is emphasized, showing how changing the background color in the 'app.css' file affects the appearance of the page.

The practical application of importing CSS files with the same name as their corresponding components is mentioned, providing a clear structure for managing styles.

The 'strict-mode' component is introduced, explaining its purpose in providing more detailed error messages and warnings during development.

The process of rendering content to the screen using React is described, detailing the translation of 'HTML' into JavaScript operations on the DOM.

The concept of components in React is briefly introduced, hinting at the more in-depth coverage to come in later parts of the course.

The importance of understanding the foundational concepts of React is stressed, as it enables the creation of complete projects even with just the knowledge gained from the first half of the course.

A masterclass on web development is recommended for those seeking a deeper understanding of advanced topics like SSR, Next.js, and other technologies.

The practical example of using 'app.css' to style the application is provided, demonstrating the immediate visual impact of changing the background color.

The transcript concludes by encouraging learners to be proud of their progress and to look forward to the upcoming lessons on components and more advanced React topics.

Transcripts

play00:00

episodio 4 del corso di react vi ho

play00:02

lasciato parlando della struttura del

play00:04

progetto abbiamo visto che dentro questa

play00:07

Source ci sono dei file li abbiamo

play00:10

nominati Ma oltre quello non siamo

play00:12

andati e non siamo andati perché perché

play00:14

dobbiamo parlare della sintassi di react

play00:17

e soprattutto di come funziona il giro

play00:20

all'interno dei vari file perché Perché

play00:22

non è niente come può sembrare e

play00:23

all'inizio è veramente confusionario

play00:26

qualsiasi framework all'inizio è

play00:28

confusionario semplicemente perché

play00:30

arrivate da una mentalità se avete fatto

play00:32

il percorso classico ripeto HTML CSS

play00:34

JavaScript più diretta Quindi siete

play00:36

abituati a lavorare più direttamente con

play00:38

le vostre pagine col vostro codice col

play00:40

vostro codice di stile eccetera non

play00:43

siete abituati a questo giro incredibile

play00:47

che è veramente confusionario all'inizio

play00:49

perciò partiamo dal nostro Index HTML

play00:52

che vi ho detto che è l'entry Point del

play00:54

sito lo sapete se avete fatto già siti

play00:56

Index HTML è l'entry Point quando

play00:59

andiamo su Ad esempio

play01:01

cg.com la prima pagina è la Index HTML

play01:05

qua dentro però non abbiamo niente Se io

play01:08

tolgo vedete che abbiamo qualcosa a

play01:09

schermo intanto sto spostando Visual

play01:11

studio ma vedete che abbiamo qualcosa a

play01:12

schermo abbiamo due loki abbiamo una

play01:14

scritta abbiamo un bottone con un

play01:16

counter abbiamo sotto qualcos'altro

play01:17

eccetera Qua non abbiamo niente nel body

play01:20

abbiamo Sì ok Abbiamo la favicon vedete

play01:23

vite SVG che è questa qua in alto

play01:27

abbiamo il titolo che è quello in alto

play01:29

della della tab Ma la cosa muore lì qua

play01:32

dentro Poi abbiamo un DVD root e uno

play01:36

script SRC main jsx che già abbiamo

play01:40

visto se io vado qua e faccio F12

play01:42

andiamo qua dentro a prendere tutto

play01:44

abbiamo Body ok e abbiamo vedete div

play01:47

root e il nostro main apriamo e dentro

play01:50

c'è roba che nel nostro codice non c'è

play01:54

appunto qual è questo giro molto

play01:56

confusionario che sta facendo Allora

play01:58

abbiamo il nostro div ID root root vuol

play02:02

dire radice è la radice di tutto è la

play02:05

base di tutto è un ID Perciò è univoco

play02:08

Sapete bene che gli ID non possono

play02:10

esserci due Rot c'è un solo un Rot un

play02:12

po' come il vostro codice fiscale di

play02:14

conseguenza potete capire che da qui

play02:16

parte tutto E l'avete visto anche sulla

play02:19

pagina Ve l'ho fatto vedere con F12 da

play02:21

qui parte tutto ma quindi si desume che

play02:24

qua dentro venga iniettato qualcosa va

play02:27

bene come viene iniettato viene

play02:28

iniettato grazie al nostro codice jsx

play02:32

Quindi abbiamo la nostra pagina entry

play02:33

Point con un elemento vuoto in cui poi

play02:37

viene caricata della roba l'avete visto

play02:39

perché qua non c'è niente ma qua c'è

play02:41

roba quindi si resume che venga caricata

play02:43

dopo Quindi arriva la pagina una volta

play02:45

che arriva l'elemento vuoto viene letto

play02:47

questo main jsx che ripeto è una

play02:50

versione più carina di js quindi di

play02:53

JavaScript e una volta che legge jsx ci

play02:56

butta dentro il contenuto ma avviene

play02:59

quando la pagina è già arrivata

play03:01

Attenzione Se state guardando questo

play03:02

corso molto più avanti rispetto alla

play03:05

data di registrazione c'è una buona

play03:07

possibilità che sul mio sito cgm.it non

play03:10

solo trovate HTML CSS JavaScript e altra

play03:13

roba ma anche un masterclass di web

play03:17

Development quindi parlerò di ssr

play03:20

parlerò di min mern vari Stack gemtech

play03:25

eccetera è un corso che vi consiglio

play03:28

caldamente perché qua le cose già nel

play03:30

momento in cui avete deciso di imparare

play03:32

react diventano difficili alla svelta vi

play03:35

consiglio quel masterclass genuinamente

play03:37

non volete farle altre cose nessun

play03:39

problema Quello ve lo consiglio

play03:40

particolarmente perché ve lo consiglio

play03:42

perché la pagina arriva vuota e poi

play03:44

viene caricata ed è un modo

play03:46

completamente diverso rispetto ciò a cui

play03:48

eravamo abituati quindi ecco perché

play03:50

parlavo di quel masterclass ma torniamo

play03:51

a noi quindi abbiamo il nostro elemento

play03:53

vuoto e dentro viene caricato qualcosa

play03:55

Grazie a main jsx andiamo nel nostro

play03:57

main jsx quindi si si desume che il main

play04:00

è il principale e qua dentro abbiamo un

play04:02

po' di roba qua dentro abbiamo degli

play04:03

Import viene importata della roba ad

play04:06

esempio importiamo react dal pacchetto

play04:08

react che abbiamo qua dentro se io vado

play04:11

giù andiamo alla r vedete che abbiamo

play04:14

react react Dom e vedete che abbiamo

play04:17

react e react Dom Se io apro abbiamo

play04:19

react Dom client che è esattamente

play04:23

questo Quindi cosa sta succedendo stiamo

play04:25

importando dentro il nostro file jsx

play04:28

Ricordatevi comunque è sempre JavaScript

play04:30

un po' più bello dentro il nostro file

play04:32

JavaScript stiamo portando del Codice da

play04:36

quei pacchetti che abbiamo installato li

play04:37

abbiamo installati per un motivo per

play04:39

poterli utilizzare Dopodiché importiamo

play04:42

app jsx adesso ci arriviamo e index.css

play04:47

e adesso ci arriviamo la cosa importante

play04:50

è che noi prendiamo react Dom il Dom Se

play04:52

vi ricordate è document object Model che

play04:55

è quello che ci permette di aggiungere

play04:57

elementi dinamicamente in HTML con

play04:59

JavaScript e diciamo guarda react mi

play05:01

devi creare la root di cosa

play05:03

dell'applicazione react quindi react

play05:06

crea la sua stessa Rot e dice mi prendi

play05:09

Get Element by D root che è questo e qua

play05:13

dentro crei l'inizio di tutta

play05:16

l'applicazione react Quindi prendi

play05:19

questo elemento che è un banale elemento

play05:20

HTML ma qua dentro visto che tu sei

play05:23

react crei la base per te stesso per

play05:27

lavorare quindi fai a fare Render render

play05:30

vuol dire mandare a schermo e di

play05:32

conseguenza cosa manda a schermo ci

play05:34

manda a schermo app e app l'abbiamo

play05:37

importato da qui quello che sembra un

play05:39

elemento risetto a noi conoscevamo P

play05:42

conoscevamo H1 a eccetera abbiamo questo

play05:46

tag strano In realtà abbiamo anche

play05:47

questo tag strano Abbiamo due tag strani

play05:49

che non esistono in HTML uno ci arriva

play05:52

con react ed è strict Mode e

play05:55

semplicemente ci permette di ottenere

play05:57

molti più riferimenti di errori avvisi

play06:01

eccetera in sviluppo questa cosa qua non

play06:04

compare nel sito non è che dovete

play06:06

toglierlo quando lo mettete online non

play06:07

preoccupatevi è di react e funziona solo

play06:11

nello sviluppo perfetto ed è

play06:13

fondamentale averlo Ma la cosa veramente

play06:15

importante è che questo elemento strict

play06:18

Mode comprende questo elemento app che

play06:21

non esiste in HTML come facciamo ad

play06:23

averlo ce l'abbiamo perché abbiamo

play06:24

importato app da App jsx che guarda caso

play06:28

è una cosa che abbiamo qui Quindi se

play06:29

apriamo app jsx attenzione abbiamo un

play06:33

po' di roba Abbiamo una function app che

play06:37

guarda caso si chiama esattamente come

play06:39

il file che guarda caso si chiama

play06:40

esattamente come il nome qui e qua

play06:44

dentro abbiamo

play06:46

dell'html che però non è vero HTML è un

play06:49

HTML contenuto in un Return di una

play06:52

function Quindi noterete come in react

play06:56

non si lavora con l'html puro Come si fa

play06:59

in angular Come si fa in svelt ad

play07:01

esempio e poi si mette insieme il codice

play07:04

JavaScript in react è tutto JavaScript

play07:08

semplicemente Scriviamo qua dentro

play07:09

dell'html che viene riconosciuto come

play07:11

tale ma in realtà poi viene costruito

play07:14

come JavaScript quindi viene poi creato

play07:16

un elemento div in cui poi viene creato

play07:18

un elemento a un altro elemento a

play07:21

eccetera eccetera Quello che c'è di

play07:22

sotto noi lo vediamo come html in realtà

play07:25

è document Get Element by D document

play07:29

create Element document append eccetera

play07:33

eccetera eccetera Se conoscete il lavoro

play07:35

che c'è sul Dom di JavaScript quello che

play07:38

noi vediamo qua in realtà viene tradotto

play07:40

poi in quello di base abbiamo una

play07:42

funzione app quindi un componente è una

play07:45

funzione li potreste scrivere anche come

play07:47

classi ma è stata superata come cosa

play07:49

quindi i componenti non sono classi ma

play07:51

sono funzioni abbiamo una funzione che

play07:54

ritorna semplicemente dell'html almeno

play07:57

dal nostro punto di vista visivo in

play07:59

realtà ripeto sotto banco react va a

play08:02

utilizzare document create document Get

play08:05

Element document attribute Get

play08:08

attribute Class names eccetera eccetera

play08:10

Ok non torniamo su quello quello che noi

play08:13

vediamo È HTML quindi react prende tutta

play08:15

sta roba e la manda a schermo è l'unica

play08:17

cosa che ci interessa il discorso è che

play08:19

abbiamo qua un elemento vuoto di cui

play08:21

parleremo più avanti abbiamo poi qua il

play08:23

nostro div quindi se ci fate caso

play08:25

abbiamo un div con dentro due link che

play08:27

guarda caso è im vit logo e immagine

play08:31

react logo al momento lasciate perdere

play08:33

sta cosa ne parleremo quando spieghiamo

play08:36

jsx Però potete capire che questa

play08:38

immagine c'è il logo di vit questa

play08:39

immagine c'è il logo di react sono

play08:41

entrambi due link e poi sotto abbiamo

play08:43

vit + react Sì e poi abbiamo un div con

play08:46

dentro il bottone vedete button on click

play08:49

fai qualcosa account is e poi abbiamo

play08:52

Edit e click se io mi sposto è

play08:55

esattamente il contenuto quindi possiamo

play08:57

dedurre che Index è è la pagina che

play09:00

arriva l'utente main è ciò che permette

play09:03

a react di partire ho cambiato qualcosa

play09:06

ok Sì avevo scritto qua delle cose

play09:08

dicevo main è ciò che permette ad index

play09:11

di cominciare a prendere contenuto e

play09:13

dice react mettiti in moto react deve

play09:16

avere la sua applicazione Qua Qua stiamo

play09:19

solo facendo partire react è un po' come

play09:22

un motore Facciamo partire il motore ma

play09:24

poi non abbiamo la macchina il motore

play09:25

sta lì fermo tu sì ok sta sul tavolo che

play09:28

si va bene ma senza una macchina app è

play09:32

la nostra macchina effettiva è la nostra

play09:33

applicazione Quindi qua dentro abbiamo

play09:35

ciò che effettivamente vediamo a schermo

play09:37

che viene esportata perché deve essere

play09:39

poi importata qui eccetera eccetera

play09:42

abbiamo poi state che vedremo più avanti

play09:44

le cose che ci interessano sono Abbiamo

play09:46

qua i due loghi abbiamo state che ci

play09:49

permette di utilizzare state quindi tut

play09:50

Allora questo non ci interessa ancora

play09:52

questi due sono banali loghi che abbiamo

play09:54

importato quindi uno da vit vedete slash

play09:58

Vit va subito nel Public l'altro è Slash

play10:00

assets E questo ce l'abbiamo qui nel

play10:02

Public ripeto perché ci serve come

play10:05

favicon vedete e qua il nostro Index non

play10:08

accede dentro a Source accede

play10:10

direttamente a Public Poi vedremo quando

play10:13

faremo la build in sostanza Ma al di là

play10:16

di questo la cosa che ci interessa è app

play10:18

CSS Perché Perché se io vado a toglierlo

play10:20

e faccio partire abbiamo no stile

play10:23

abbiamo una base di stile ma non c'è ciò

play10:26

che mette react al centro vedete non

play10:28

l'abbiamo al centro i loghi non girano

play10:31

se passo sopra non c'è un overlay non

play10:32

c'è niente Se invece lo riporto indietro

play10:35

vediamo che cosa ci ridava Scusatemi

play10:37

questo stile Ci ridava vedete il logo

play10:40

che gira se passo sopra crea questo

play10:42

effetto abbiamo tutto al centro è

play10:44

stilato con la grandezza giusta eccetera

play10:47

eccetera quindi possiamo capire che ci

play10:49

basta importare lo stile andando a

play10:51

mettere l'import e importiamo CSS

play10:54

tendenzialmente gli date lo stesso nome

play10:57

del del vostro componente quindi già

play10:59

questo è un componente Poi ne parliamo

play11:01

nel prossimo video di cosa sono i

play11:02

componenti Però sappiate che se andate a

play11:05

creare una navbar e volete stirare la

play11:07

navbar avrete navbar.js e navbar.css se

play11:11

andiamo quindi a aprire CSS abbiamo lo

play11:14

stile del componente app e in Index CSS

play11:18

invece abbiamo lo stile di tutto quindi

play11:21

vi faccio vedere che se vado a cambiare

play11:23

il background color da 24 24 24 a Red

play11:27

faccio così tac

play11:29

apriamo vedete è diventato tutto rosso

play11:31

togliamo sta roba che mi stanno morendo

play11:34

gli occhi perfetto Salvo è tornato come

play11:37

prima andiamo però a cambiare App CSS e

play11:40

magari facciamo background color Red

play11:45

andiamo a vedere vedete che è diventato

play11:46

solo questa parte quindi Index CSS

play11:49

Controlla tutta la pagina Index HTML app

play11:53

CSS Controlla esclusivamente ciò che è

play11:56

legato ad App jsx che è tutta sta parte

play11:59

Ok questa è la base più becera di react

play12:04

se capite il giro del fumo è un ottimo

play12:07

punto di partenza perché poi in realtà

play12:09

molto di jsx lo vedremo nei prossimi

play12:11

video si capisce i componenti si

play12:13

capiscono diventa più complesso da metà

play12:16

corso in poi ma già potete far tanto con

play12:19

le conoscenze da zero a metà corso non

play12:22

potete fare un progetto intero vero Ma

play12:24

potete far tanto quindi dovete essere

play12:26

già orgogliosi che pian piano stiamo

play12:27

aggiungendo roba non andamo tempo e

play12:29

parliamo di componenti ci vediamo tra

play12:31

poco

Rate This

5.0 / 5 (0 votes)

関連タグ
ReactJSWeb DevelopmentProject StructureSyntax BasicsFile InterplayFront-EndJavaScriptCoding TutorialWeb DesignDevelopers
英語で要約が必要ですか?