Advertisement
IlanZiin

#046 VÁRIOS COMPONENTES NO MESMO FICHEIRO

Sep 25th, 2022
1,073
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. App.jsx
  2. ------------------------------------------------------------------
  3. import React from 'react'
  4. import { Componente1, Componente2, Componente3 } from './Componentes'
  5.  
  6. export default function App(){
  7.  
  8.     return (
  9.         <>
  10.             <h1>React - Multiplos componentes no mesmo arquivo</h1>
  11.             <hr />
  12.             <Componente1></Componente1>
  13.             <Componente2></Componente2>
  14.             <Componente3></Componente3>
  15.         </>
  16.     )
  17. }
  18. ------------------------------------------------------------------
  19. Componentes.jsx
  20. ------------------------------------------------------------------
  21. import React from 'react'
  22.  
  23. const Componente1 = () => {
  24.     return (
  25.         <>
  26.             <h3>Componente 1</h3>
  27.         </>
  28.     )
  29. }
  30.  
  31. const Componente2 = () => {
  32.     return (
  33.         <>
  34.             <h3>Componente 2</h3>
  35.         </>
  36.     )
  37. }
  38.  
  39. const Componente3 = () => {
  40.     return (
  41.         <>
  42.             <h3>Componente 3</h3>
  43.         </>
  44.     )
  45. }
  46.  
  47. export {Componente1, Componente2, Componente3}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement