Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

Rescreva essa parte da string com as seguintes condições: 1. Não elimine NENHUMA…

  1. User

    Rescreva essa parte da string com as seguintes condições: 1. Não elimine NENHUMA informação dada no artigo. 2. Termos, variáveis, expressões ou referências devem ser SEMPRE mantidos em inglês. 3. Apenas transcreva o artigo para um inglês mais simples, tornando ele mais literal e direto, sem alterar o contexto. 4. Não remova as tags HTML e nem os "#thedivisor#". 5. Você deve me enviar sua resposta em texto puro, sem markdown.

      React components use <em>props</em> to talk to each other. Every parent component can send information to its child components by giving them props. Props might look like HTML attributes, but you can send any JavaScript value through them, including objects, arrays, and functions.#thedivisor#<li class="leading-relaxed mb-1">How to pass props to a component</li>
    
  2. Assistant

    React components use props to communicate with each other. Every parent component can send information to its child components by providing them props. Props may look like HTML attributes, but you can send any JavaScript value through them, including objects, arrays, and functions. #thedivisor# How to pass props to a component How to read props from a component How to set default values for props How to send some JSX to a component How props change over time #thedivisor# Props are the information you send to a JSX tag. For instance, className, src, alt, width, and height are some props you can send to an <img>: #thedivisor# The props you can send to an <img> tag are predefined (ReactDOM follows the HTML standard). However, you can send any props to your own components, like <Avatar>, to customize them. Here’s how! #thedivisor# In this code, the Profile component is not sending any props to its child component, Avatar: #thedivisor# You can give Avatar some props in two steps. #thedivisor# First, send some props to Avatar. For example, let’s send two props: person (an object), and size (a number): #thedivisor# If double curly braces after person= confuse you, remember they are just an object inside the JSX curlies. #thedivisor# Now you can read these props inside the Avatar component. #thedivisor# You can read these props by listing their names person, size separated by commas inside ({ and }) right after function Avatar. This lets you use them inside the Avatar code, just like you would with a variable.