Skip to content

From v7 to v9: renderDay #2357

Answered by gpbl
jani-huhtala asked this question in Support
Aug 7, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @jani-huhtala, renderDay has been replaced by a custom component.

You can render the link by using the Day custom component, for example:

https://stackblitz.com/edit/react-day-picker-9-2332-fmbt5x?file=src%2FApp.tsx

import { useState } from 'react';
import './App.css';
import 'react-day-picker/style.css';
import { DayPicker } from 'react-day-picker';

function App() {
  const reservedDates = [new Date(2024, 7, 1)];
	
  return (
    <DayPicker
      modifiers={{
        reserved: reservedDates,
      }}
      components={{
        Day: (props) => {
          const { day, modifiers, ...restProps } = props;

          // please note that the date is inside the object `day`
          console.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by gpbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants