-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create .d.ts files for TypeScript #28
Comments
As a quick fix, you can create a It should silence the error. |
Here is a minimalist declaration.d.ts file declare module 'react-responsive-masonry' {
import * as React from 'react';
const Masonry: React.FC<{
columnsCount?: number
gutter?: string
}>
export const ResponsiveMasonry: React.FC<{
columnsCountBreakPoints?: Record<number, number>
}>
export default Masonry
} |
Put it inside the 'src' folder if you're using React |
In addition to @popzelife's declaration file, you can add additional props to support styling: import React, { CSSProperties } from 'react'
const Masonry: React.FC<{
columnsCount?: number
gutter?: string
className?: string
style?: CSSProperties
}>
export const ResponsiveMasonry: React.FC<{
columnsCountBreakPoints?: Record<number, number>
className?: string
style?: CSSProperties
}> |
We can leverage Using yarn: |
Hey,
thanks for the project! 💯
Sadly my CI currently fails as it expects the types declared.
Now, I have never done this and would try to do it, however, if it an easy task for you I'd appreciate the help.
Let me know!
The text was updated successfully, but these errors were encountered: