Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!