Skip to content

Availability of the property renderDay property in v8? #1174

Answered by gpbl
lmaze asked this question in Support
Discussion options

You must be logged in to vote

@lmaze thanks for the heads up!

What are you using the renderDay prop for? Using the DayContent custom component should be enough to replace renderDay: https://react-day-picker-next.netlify.app/guides/custom-components

import * as React from 'react';
import { DayContent, DayContentProps, DayPicker } from 'react-day-picker';

import { format } from 'date-fns';

function DateTime(props: DayContentProps) {
  const dateTime = format(props.date, 'yyyy-MM-dd');
  return (
    <time dateTime={dateTime}>
      <DayContent {...props} />
    </time>
  );
}

export default function App() {
  return <DayPicker components={{ DayContent: DateTime }} />;
}

Replies: 1 comment 1 reply

Comment options

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

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