Skip to content

Commit

Permalink
nomes de componentes/atributos/props em inglês
Browse files Browse the repository at this point in the history
  • Loading branch information
volinha committed Mar 2, 2022
1 parent 423afb2 commit fc15036
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions beta/src/pages/reference/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,31 @@ Se você usar ["pedaços"](/learn/add-react-to-a-website) do React aqui e ali, c
<Sandpack>

```html public/index.html
<nav id="navegacao"></nav>
<nav id="navigation"></nav>
<main>
<p>Este parágrafo não é renderizado pelo React (abra index.html para verificar).</p>
<section id="comentarios"></section>
<section id="comments"></section>
</main>
```

```js index.js active
import './styles.css';
import { render } from 'react-dom';
import { Comentarios, Navegacao } from './Components.js';
import { Comments, Navigation } from './Components.js';

render(
<Navegacao />,
document.getElementById('navegacao')
<Navigation />,
document.getElementById('navigation')
);

render(
<Comentarios />,
document.getElementById('comentarios')
<Comments />,
document.getElementById('comments')
);
```

```js Components.js
export function Navegacao() {
export function Navigation() {
return (
<ul>
<NavLink href="/">Home</NavLink>
Expand All @@ -108,19 +108,19 @@ function NavLink({ href, children }) {
);
}

export function Comentarios() {
export function Comments() {
return (
<>
<h2>Comentarios</h2>
<Comentario texto="Olá!" autor="Sophie" />
<Comentario texto="Como vai você?" autor="Sunil" />
<Comment text="Olá!" author="Sophie" />
<Comment text="Como vai você?" author="Sunil" />
</>
);
}

function Comentario({ texto, autor }) {
function Comentario({ text, author }) {
return (
<p>{texto} — <i>{autor}</i></p>
<p>{text} — <i>{author}</i></p>
);
}
```
Expand All @@ -147,18 +147,18 @@ import App from './App.js';
let i = 0;
setInterval(() => {
render(
<App contador={i} />,
<App counter={i} />,
document.getElementById('root')
);
i++;
}, 1000);
```

```js App.js
export default function App({contador}) {
export default function App({counter}) {
return (
<>
<h1>Olá, mundo! {contador}</h1>
<h1>Olá, mundo! {counter}</h1>
<input placeholder="Digite algo aqui!" />
</>
);
Expand Down

0 comments on commit fc15036

Please sign in to comment.