1

I have a react component for thumbnails in client,

export default function Thumbnail({
  url,
  updatedDate, // updatedDate is from server api
}) {
  const cachedDate = new Date(.....);
  const queryStr = cachedDate < updatedDate ? '?force=' + Math.random() : '';

  return (
    <img
      src={url + queryStr}
      alt={'THUMB'}
    />

)}

How can I get cachedDate? Is it possible?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.