title: React hooks show more/less text like in youtube comments section
body: <p>I have some array of comments like in youtube comments section and i wan't to make it show less/more button for long comment. I've stuck a little on a way to do it locally on item without total rerender (rebuild of block) or any states values.</p>
  
  <pre><code>function commentsGenerate() {
      let block = comments.map((comment, i) =&gt; {
          let splitLength = 400
          let shortDesc = comment || '' // for null vals
  
          let shortened = false
          if (shortDesc.length &gt; splitLength) shortened = true
  
          shortDesc = shortDesc.substring(0, splitLength)
  
          return (
            &lt;div key={i}&gt;
              &lt;div&gt;{`${shortDesc}${shortened ? '...' : ''}`}&lt;/div&gt;
              {shortened &amp;&amp; &lt;Button onCLick={ () =&gt; {'how?'} &gt;More&lt;/Button&gt;}
            &lt;/div &gt;
          )
        })
  
  
      setSectionBlock(block)
    }
  </code></pre>