You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mounting react-timeago and updating the date-state later will result in an incorrect display. As a workaround we have set the "key"-property to "date.now()".
Description
Mounting
react-timeago
and updating the date-state later will result in an incorrect display. As a workaround we have set the "key"-property to "date.now()".How to reproduce?
Step 1
Open codesandbox: https://codesandbox.io/s/pensive-sea-oy63x2?file=/demo.tsx
You will see this:
Acutal behavior as expected
less than a minute ago
. Everything is fine until here.Step 2
Click on button "set date" updates the state to "new Date()"
You will see this:
less than a minute ago
less than a minute from now
With the workaround we can fix this behavior until here.
Step 3
Spam clicks on button "sets date" will cause the issue to the worarounded variant too.
less than a minute ago
less than a minute from now
The text was updated successfully, but these errors were encountered: