-
-
Notifications
You must be signed in to change notification settings - Fork 231
Closed
Labels
Description
Hi, I am trying to use the react-to-print library in my application but without satisfactory results so far. I don't know how I should send the reference to the ReactToPrint component, I appreciate any suggestions. Grateful in advance.
Note: the component I want to print is the FormContent of type class .
<Paper>
<Grid container direction="column" spacing={1}>
<Grid item xs={12}>
<Grid container direction="row">
<Grid item xs={6}>
<FormTopLeft />
</Grid>
<Grid item xs={6}>
<ReactToPrint
trigger={() => (
<Tooltip title="Print">
<IconButton>
<PrintIcon />
</IconButton>
</Tooltip>
)}
content={() => this.componentRef}
/>
</Grid>
</Grid>
<Divider/>
</Grid>
<Grid item xs={12}>
<FormContent ref={el => (this.componentRef = el)} />
</Grid>
</Grid>
</Paper>