From a07ed29bc41e1c0d7d66a9319f04c27463895370 Mon Sep 17 00:00:00 2001 From: Fernando Dodino Date: Thu, 9 Nov 2023 22:47:57 -0300 Subject: [PATCH] Remove warning and search on init --- src/components/MailReader.jsx | 5 +++++ src/components/MailsGrid.jsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/MailReader.jsx b/src/components/MailReader.jsx index 216da1f..ff8ed2a 100644 --- a/src/components/MailReader.jsx +++ b/src/components/MailReader.jsx @@ -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)} // diff --git a/src/components/MailsGrid.jsx b/src/components/MailsGrid.jsx index acf357e..bf3732d 100644 --- a/src/components/MailsGrid.jsx +++ b/src/components/MailsGrid.jsx @@ -38,7 +38,7 @@ export const MailsGrid = ({ mails, alLeerMail }) => { } return ( - +