diegomura / diegomura/react-pdf

Can't integrate with React-intl

Open
#2,354 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

I am trying to localize react-pdf using react-intl, but I get Unhandled Runtime Error
Error: [React Intl] Could not find required `intl` object. needs to exist in the component ancestry.

I created a Viewer component and wrapped with injectIntl from react-intl package. It is a standard way of internationalization of the components. As soon as I wrapped it with injectIntl I got above error.

The component is as follows, simplified
```
import {Document, Page, View} from "@react-pdf/renderer";
import React, {Component} from "react";
import {injectIntl} from "react-intl";

class Viewer extends Component {
render() {
let {intl}=this.props;

return (



{/*//Some components*/}



);
}
}

export default injectIntl(Viewer);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.