-
Notifications
You must be signed in to change notification settings - Fork 3
Type definitions #8
Comments
has anybody found a way to use this package properly with Typescript? |
Same problem here, thanks. |
I have the same problem. Please guys it would be awesome to use it with Typescript. Thanks! |
I would like this as well. For now I've done what the OP suggested, and then use the declarations differently. Instead of using npm install -D @types/styled-components declare module '@react-pdf/styled-components' {
export { default } from 'styled-components';
} import { Page } from '@react-pdf/renderer';
const StyledPage = styled(Page)`
background-color: #E4E4E4;
`;
const MyDocument = () => (
<StyledPage size="A4"></StyledPage>
); Now |
Hey! Wanted to ask. How much are you using the styled components interface for react-pdf and how good did it work? |
@diegomura it's working great for us as is, we are generating thousands of documents daily with this approach and IMHO |
Are there any typescript typedefinitions available for this package? I tried grabbing the type definitions directly from the 'styled-components' package:
or
but I still get type errors like:
Property 'Text' does not exist on type 'typeof import("@react-pdf/styled-components")'.
or
Type 'Style' is not assignable to type 'CSSProperties'
The text was updated successfully, but these errors were encountered: