Skip to content

Instantly share code, notes, and snippets.

@Tiagoperes
Created January 26, 2020 20:01
Show Gist options
  • Select an option

  • Save Tiagoperes/1ff1d64031386d6882bacdd91798aa96 to your computer and use it in GitHub Desktop.

Select an option

Save Tiagoperes/1ff1d64031386d6882bacdd91798aa96 to your computer and use it in GitHub Desktop.
Exemplo usando props
import React, { useState } from 'react'
import YearMonthSelector from './YearMonthSelector'
import InvoiceResult from './InvoiceResult'
import InvoiceDispute from './InvoiceDispute'
const Invoice = () => {
const [year, setYear] = useState()
const [month, setMonth] = useState()
const [refetchInvoice, setRefetchInvoice] = useState()
const [selectedItem, setselectedItem] = useState()
return (
<>
<YearMonthSelector year={year} month={month} setYear={setYear} setMonth={setMonth} />
<InvoiceResult
year={year}
month={month}
refetchInvoice={refetchInvoice}
setRefetchInvoice={setRefetchInvoice}
selectedItem={selectedItem}
setselectedItem={setselectedItem}
/>
<InvoiceDispute invoiceEntry={selectedItem} onSubmit={() => setRefetchInvoice(true)} />
</>
)
}
export default Invoice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment