DylanVann / ant-design-draggable-modal

The Modal from Ant Design, draggable.
https://ant-design-draggable-modal.netlify.com
MIT License
166 stars 54 forks source link

Typescript declaration for DraggableModalProps not supporting children #9

Closed chrisbchrist closed 4 years ago

chrisbchrist commented 5 years ago

Hey, great library! Tried to implement this in a TypeScript app, but the compiler throws errors when trying to pass child elements to the DraggableModal. Took a look at the types and it looks like you're setting DraggableModalProps to the default AntD ModalProps, but they don't account for the children prop that's passed when the Modal has descendant elements.

I originally fixed this by extending DraggableModalProps to include children, but typing DraggableModal as a FunctionComponent is probably an easier solution as it will allow the component to inherit children automatically.

I've made a PR, but it's simple to correct.

DylanVann commented 4 years ago

Thanks for the PR!