read-more-react
read-more-react copied to clipboard
Text is not changing even if the props passed to it changes.
{
description && <ReadMore
text={description}
min={80}
ideal={100}
max={200}
readMoreText="See more"
/>
}
Even if the props value description is changing the text displayed is older once. And when I reload the page it is displaying it correctly.
Hey,
You probably might not need this as it's over a year old but adding a key={description}
prop to component should do the trick. You can find more information here: https://stackoverflow.com/questions/38892672/react-why-child-component-doesnt-update-when-prop-changes
Solution: { description && <ReadMore key={description} text={description} min={80} ideal={100} max={200} readMoreText="See more" /> }