Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- App.jsx
- ------------------------------------------------------------------
- import React from 'react'
- import { Componente1, Componente2, Componente3 } from './Componentes'
- export default function App(){
- return (
- <>
- <h1>React - Multiplos componentes no mesmo arquivo</h1>
- <hr />
- <Componente1></Componente1>
- <Componente2></Componente2>
- <Componente3></Componente3>
- </>
- )
- }
- ------------------------------------------------------------------
- Componentes.jsx
- ------------------------------------------------------------------
- import React from 'react'
- const Componente1 = () => {
- return (
- <>
- <h3>Componente 1</h3>
- </>
- )
- }
- const Componente2 = () => {
- return (
- <>
- <h3>Componente 2</h3>
- </>
- )
- }
- const Componente3 = () => {
- return (
- <>
- <h3>Componente 3</h3>
- </>
- )
- }
- export {Componente1, Componente2, Componente3}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement