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

202
Vistas
text.slice is not a function - How to slice some text from a ReactMardown component?

I'm implementing a read more read less button in a nextjs app with strapi backend. I try to use a .slice but the text comes from the API through a ReactMarkdown component.

So I get this error :

TypeError : text.slice is not a function

I started with this before I got stopped by the error

const ReadMore = ({ children, maxCharacterCount = 100 }) => { const text = children;

const resultString = text.slice(0, 100);

return (

{resultString} Read more {/* {isTruncated ? "Voir plus" : "Voir moins"} */}

);

 <ReadMore>
       <ReactMarkdown source={item.texte} />
  </ReadMore>
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