React04 – Props

A name will be passed to the HelloWorld component:

In order for the HelloWorld application to receive the passed value, the following changes will need to be made:

Your browser window will look like this:

First define the constant that will contain the values. Finally, this constant is passed through a parameter called info.

The receiver of the object will access its values as follows:

The result will be as follows:

Sometimes we are only interested in a few properties from all the ones sent to us.

App.jsx

HelloWorld.jsx

Another project is created

App.jsx

Parents.jsx

Son.jsx

Daughter.jsx

grafeno30

Computer science teacher, former analyst/programmer for the Andalusian Regional Government. He holds a degree in computer engineering from the Higher Technical School of Seville.

Ver todas las entradas