react displays html
changes taht html when the user does something
wrtite html in js is called jsx
functioin hat return signle project can have so many diferent components inside of it
we can wrtite in two ways
write react to create a normal html element
write react to show another component
=
write another componetn in app component
===
process the cod eand showi in html
first call app.js and then its call remmaining compoinents which sahared with app. js
staep by step calling
call div
then h1 then call contactlist app
questions
so whats react all about ?
react can develop interactive websites, what it will do is
it can take user actions based otn that process html
each indivudal component is used to create a protion of the applicaiton
differnece between plaiun htm and componetn is
plain html starts with small letters
components starts with capital case
======
question
Imagine you are working on a project with two React components. Here is the code for each:
App.js
- function App() {
- return (
- <div>
- <h1>Cake Recipe</h1>
- <Recipe />
- </div>
- );
- }
Recipe.js
- function Recipe() {
- return (
- <ul>
- <li>100g Sugar</li>
- <li>200g Flour</li>
- <li>500ml Water</li>
- </ul>
- )
- }
- <div>
- <h1>Cake Recipe</h1>
- <ul>
- <li>100g Sugar</li>
- <li>200g Flour</li>
- <li>500ml Water</li>
- </ul>
</div>
If React tried to show the App component (the code in the App.js file), what would the final HTML displayed on the screen probably look like?
=====
how does a react app start up
npm run build
it getnerates html file and bundled js
if user
==
what were the usestate functions
how did the text get translated to another language
No comments:
Post a Comment