CezaryDanielNowak / React-dotdotdot

Multiline text ellipsis for react. Demo:
https://nowak.click/react-dotdotdot/
MIT License
401 stars 54 forks source link

Clamp does not rerender on state change #47

Open Jaikant opened 5 years ago

Jaikant commented 5 years ago

I am passing the number of lines to clamp which is stateful. Clamp does not rerender when the state changes

  const [ lines, setLines ] = useState(3);
  return (
      <Dotdotdot clamp={lines}>
          <Bio onClick={() => setLines(ln => (ln === 3 ? 0 : 3))}>
             {bio}
          </Bio>
      </Dotdotdot>
MaxMusin commented 3 years ago

Same issue... Someone found a solution to this?