Closed atherdon closed 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.
@atherdon I left a task because I did not understand.
Tell me what is not clear for you?
Where should I define that array? inside which component? AppComponent? I wonder if it's not for future tasks 😶 .
you should define it outside the components. it'll be like a submodule. google about it
I wonder if it's not for future tasks
Not clear what do you mean
just imagine that you'll need to display a whole calendar with data about moths, days, etc. what structure you'll use?
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.
if it'll looks simple - do this. don't want to have a very complex code
Hi @atherdon. Please, can you review what I did. Thanks.
ok, you can move to the next chapter.
https://medium.com/quick-code/lets-learn-react-chapter-3-components-components-components-3492f771d623
Expected result
Test
1