Skip to content

tileContent is not updated when activeStartDate changes #576

@akouryy

Description

@akouryy

Before you start - checklist

  • I followed instructions in documentation written for my React-Calendar version
  • I have checked if this bug is not already reported

Description

I tried to add tile contents depending on the active month. However, the cached return value of tileContent function is not invalidated after the change of activeStartDate. As a result, some tiles are displayed as if activeStartDate were in another month.

Steps to reproduce

  1. Go to https://codesandbox.io/s/priceless-tdd-e6e7g?file=/src/App.js.
  2. Show Jan 2022. A check mark is displayed for each day in Jan.
  3. Move to Dec 2021.

Expected behavior

tileContent is re-evaluated for Dec 27th to Jan 2nd, so check marks appear in Dec 27th to 31st.

Actual behavior

Tile contents are cached and marks are still displayed for Jan 1st and 2nd.

Additional information

No response

Environment

  • Browser (if applicable): Chrome 96
  • React-Calendar version: 3.5.0
  • React version: 17.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions