GroceriStar / react-only-intern-22

GNU General Public License v3.0
0 stars 0 forks source link

Master React, Quick Code tutorial. Part 3 #4

Closed atherdon closed 6 years ago

atherdon commented 6 years ago

https://medium.com/quick-code/lets-learn-react-chapter-3-components-components-components-3492f771d623

Expected result

Test

nioperas06 commented 6 years ago

React component is just like an element describing the DOM node. They can be nested and mixed with each other. Adjacent JSX elements must be wrapped in an enclosing tag because React element has to return only one element. We'll have to wrap both of our tags with another element tag.

nioperas06 commented 6 years ago

@atherdon I left a task because I did not understand.

atherdon commented 6 years ago

Tell me what is not clear for you?

nioperas06 commented 6 years ago

Where should I define that array? inside which component? AppComponent? I wonder if it's not for future tasks 😶 .

atherdon commented 6 years ago

you should define it outside the components. it'll be like a submodule. google about it

atherdon commented 6 years ago

I wonder if it's not for future tasks

Not clear what do you mean

atherdon commented 6 years ago

just imagine that you'll need to display a whole calendar with data about moths, days, etc. what structure you'll use?

nioperas06 commented 6 years ago

Somthing like this: Pseudo code App.ts for (let month of months) { <Month /* pass something like name or id to that component */ /> } Month.ts ` let days = ... (get month days) for (let day of days) {

} ` Inside Day component I can do something like WeekChecker.

atherdon commented 6 years ago

if it'll looks simple - do this. don't want to have a very complex code

nioperas06 commented 6 years ago

Hi @atherdon. Please, can you review what I did. Thanks.

atherdon commented 6 years ago

ok, you can move to the next chapter.