Skip to content

Custom Component too many rerender #2667

Answered by rodgobbi
SoheeP asked this question in Support
Discussion options

You must be logged in to vote

Hi @SoheeP
I just noticed that the documentation for Custom Components is misleading, you are passing the custom components exactly as the documentation specifies, but you should pass the functional components directly, as follow:

        components={{
          MonthGrid: CustomMonthGrid,
          MonthCaption: CalendarCustomMonthCaption,
          Weekdays: CustomWeekdays,
          Weekday: CustomWeekday,
          Weeks: CustomWeeks,
          Week: CustomWeek,
          Day: CalendarCustomDay,
        }}

You'll have to change the way you pass the imgSrc prop to the CalendarCustomDay, as you cannot inline the render function for it as currently stated in the docs.
One potential solu…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@SoheeP
Comment options

Answer selected by SoheeP
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants