diegomura / diegomura/react-pdf
Can't integrate with React-intl
- 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
Assessment
This issue has not been assessed yet.