react-xmasonry icon indicating copy to clipboard operation
react-xmasonry copied to clipboard

Please include ref props types for Typescript

Open hjpunzalan opened this issue 3 years ago • 4 comments

Hi,

Thank you for this wonderful tool. Could you please add props of ref of xMasonry component in the type file definition. Will it be possible to add gaps for this component?

hjpunzalan avatar Nov 14 '21 16:11 hjpunzalan

Hello!

Sorry for the late reply; pull requests are very welcome!

nikitaeverywhere avatar Nov 26 '21 07:11 nikitaeverywhere

is anyone there typed ref props properly..? please share it via comment. thanks in advance!

tkmin avatar Aug 31 '22 05:08 tkmin

is anyone there typed ref props properly..? please share it via comment. thanks in advance!

I just needed containerWidth, so I wrote type like this below.. (maybe not a proper way, but it works anyway)

type CustomXMasonryProps = Component<XMasonryProps, {}, any> & { containerWidth: number };
const xMasonryRef = useRef<CustomXMasonryProps>(null);

tkmin avatar Aug 31 '22 07:08 tkmin

I see no problem in using <XMasonry ref={...}></XMasonry>. What's the issue with it? Can you please reproduce or suggest a fix? Thanks!

nikitaeverywhere avatar Sep 10 '22 18:09 nikitaeverywhere

Closing this due to inactivity.

nikitaeverywhere avatar Mar 17 '23 10:03 nikitaeverywhere