Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Creating React Components | React Components
Introduction to React

bookCreating React Components

In the previous chapter, we explored how we can create components and what are the basic possibilities. There are, of course, more features related to components which we will explore in further chapters, but for now, we need to make sure that we have a good grasp of the concepts that have been discussed.

Task

The base code is already given with a data array containing some students' names and their scores. It also contains a getGrade function that takes in a score and outputs a grade.

Write a functional component called Grades at line 24 and create an unordered list inside it. Inside the list, use the data array to render list items having student names along with their grades in the form StudentName – Grade, for example, Aron - F.

You can use getGrade function to get the relevant grade. Also, don't forget to render the component inside the render method at line 36.

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 3

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Still meg spørsmål om dette emnet

Oppsummer dette kapittelet

Vis eksempler fra virkeligheten

Awesome!

Completion rate improved to 2.7

bookCreating React Components

Sveip for å vise menyen

In the previous chapter, we explored how we can create components and what are the basic possibilities. There are, of course, more features related to components which we will explore in further chapters, but for now, we need to make sure that we have a good grasp of the concepts that have been discussed.

Task

The base code is already given with a data array containing some students' names and their scores. It also contains a getGrade function that takes in a score and outputs a grade.

Write a functional component called Grades at line 24 and create an unordered list inside it. Inside the list, use the data array to render list items having student names along with their grades in the form StudentName – Grade, for example, Aron - F.

You can use getGrade function to get the relevant grade. Also, don't forget to render the component inside the render method at line 36.

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 3
some-alt