Skip to content

Conversation

@HecFranco
Copy link
Collaborator

Reviewed and readme_es file created


export const HelloComponent = (props) =>
<h2>Hello user: {props.userName}!</h2>;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the proptypes here?


In this example we will only use the `render` method of React-DOM, so we will only import that (` import {render} from 'react-dom'; `).

Now we will modify the __[hello.jsx](./src/hello.jsx)__ to add a **proptypes** that will check the input variable to make sure it is strin type and required.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check tat properties stick to a given contract (in this case prop Username is of type string and required)

En este ejemplo, solo usaremos el método `render` de React-DOM, por lo que solo lo importaremos (` import {render} from 'react-dom'; `).

Ahora modificaremos el __[hello.jsx](./src/hello.jsx)__ para agregar a los **proptypes** que verificarán la variable de entrada para asegurarse de que sea del tipo string y requerida.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here (in spanish): verificaran que las propiedades cumplen con un contrato dado (en este caso la propiedad Username es de tipo string y debe ser informada)

@brauliodiez brauliodiez merged commit 822352c into Lemoncode:master Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants