Skip to content

<Link> returned from render function crashes react-pdfΒ #1080

Description

@vanhanit

Describe the bug
When returning a <Link> component from a render function react-pdf crashes with a error Unhandled Rejection (Error): Type mismatch.

Returning <Text> and <View> components work as expected. Only a <Link> somewhere in the returned structure causes the crash, as far as I have tested.

To Reproduce
This crashes the rendering

<Document>
  <Page size="A4">
    <View fixed render={({ pageNumber }) =>
      <Link src="https://www.google.com">link</Link>
    } />
  </Page>
</Document>

This works as expected

<Document>
  <Page size="A4">
    <View>
      <Link src="https://www.google.com">link</Link>
    </View>
  </Page>
</Document>

Expected behavior
The document renders the same way regardless if the children are returned from the render method or supplied as children to the component.

Desktop

  • OS: Windows
  • Browsers: All tested browsers (Edge, Chrome and Firefox) has the same issue
  • React-pdf v1.6.12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions