Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
How to search posts with an keyword (strings of strings)?

I'm trying to make a search field, and I'm already able to do searches, but it only returns posts that are typed with the same title or are exactly the same which would not be interesting, this happens in my conditional if (query !== post .title && query) return null The ideal would be to search just one word and return similar posts, I've tried using the includes method as follows if (query !== post.title && query.includes(post.title) && query) return null but someone didn't work Would you help me ?

 {(() => {
          if (isLoading) return <LoadingBlock />
          if (!isLoading && postList.length === 0) return <NoDataWarning text='Nenhuma postagem encontrada.' />
          return postList.map((post, index) => {
            if (query !== post.title && query.includes(post.title) && query) return null //the problem is here
            return (
              <PostContainer position={index}>
                <PostBanner />
                <PostInfoContainer>
                  <span>
                    <AiFillCalendar />
                    {new Date(post.createdAt).toLocaleDateString()}
                  </span>
                  <span>
                    <FaUserCircle />
                    {`${post.firstName} ${post.lastName}`}
                  </span>
                </PostInfoContainer>
                <PostTitle>{post.title}</PostTitle>
              </PostContainer>
            )
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda