Skip to content

Commit

Permalink
Remove warning and search on init
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Nov 10, 2023
1 parent f8cef3f commit a07ed29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/MailReader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const MailReader = () => {
setMails(nuevosMails)
}

useEffect(() => {
buscarMails(textoBusqueda)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

// otra variante más rebuscada
// es que el InputText tenga el onchange definido como onChange={(event) => setTextoBusqueda(event.target.value)}
//
Expand Down
2 changes: 1 addition & 1 deletion src/components/MailsGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const MailsGrid = ({ mails, alLeerMail }) => {
}

return (
<DataTable value={mails} autoLayout={true} className="p-datatable-striped">
<DataTable value={mails} className="p-datatable-striped">
<Column header="Fecha" body={fechaTemplate} field="fechaOrdenamiento" sortable></Column>
<Column field="emisor" header="Enviado por" sortable></Column>
<Column field="asunto" header="Asunto" sortable></Column>
Expand Down

0 comments on commit a07ed29

Please sign in to comment.