A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/MatthewHerbst/react-to-print/issues/280 below:

Need help to send component reference · Issue #280 · MatthewHerbst/react-to-print · GitHub

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>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4