mdx-deck
mdx-deck copied to clipboard
Allows the usage of slide index in print mode
Refers to #374
Allows to retrieve the slides index using the useDeck
hook on print mode. Previously the value was always 0, because on the Print
component, the slide index is not passed to the Slide
component.
Even better would be to do this, which makes it possible to print the notes as well.
const Print = ({ slides, notes }) => {
const outer = useDeck()
const context = {
...outer,
mode: modes.print,
}
return (
<Context.Provider value={context}>
{slides.map((slide, i) => (
<Slide key={i} slide={slide} index={i} notes={notes} preview />
))}
</Context.Provider>
)
}
Would be very cool to see this merged :)