-
Beta Was this translation helpful? Give feedback.
Answered by
tjfred35
Dec 10, 2021
Replies: 1 comment 2 replies
-
You can do it with the v8 version like this: const [selected, setSelected] = React.useState<Date>();
const CustomRow = (props: RowProps) => {
return (
<>
<Row {...props} />
{selected && props.weekNumber === getWeek(selected) && (
<tr>
<td colSpan={7}>
<div
style={{
padding: "16px 8px",
display: "flex",
justifyContent: "center",
margin: "4px 2px",
border: "1px solid blue",
borderRadius: "4px"
}}
>
You selected me!
</div>
</td>
</tr>
)}
</>
);
};
return (
<DayPicker
mode="single"
selected={selected}
onSelect={setSelected}
components={{
Row: CustomRow
}}
/>
); https://codesandbox.io/s/sandpack-project-forked-9ltwx?file=/src/App.tsx:160-1020 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
gpbl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do it with the v8 version like this: