I am trying to implement ReactToPrint, to print out the contents of the export default function ToDoList (Which returns a map of the Todo cards from another class).
export default function ToDoList({ todos, toggleTodo }) {
return todos.map((todo) => {
return <Todo key={todo.id} toggleTodo={toggleTodo} todo={todo} />;
});
}
The ReactToPrint library seems to prefer if you use a Class Component, or a functional component like below.
export const ComponentToPrint = React.forwardRef((props, ref) => {
return (
<div ref={ref}>
<h2>Grocery List Contents</h2>
</div>
); });
What is the best way that I could use the ToDoList Default Function, with ReactToPrint?
Thank you for your time.