vkbansal / react-contextmenu

Project is no longer maintained
MIT License
1.4k stars 375 forks source link

Now exporting prop interfaces for extending #306

Closed R4VANG3R closed 4 years ago

R4VANG3R commented 4 years ago

Adds Exports to all the Props interfaces to allow extending them.

import { ContextMenuProps } from "react-contextmenu";

interface MyContextMenuProps extends ContextMenuProps {}

I use this for styling the components with styled-components.

For example like this:


export interface MyContextMenuProps extends IProps, ContextMenuProps {}
export const ContextMenu = (props: MyContextMenuProps) => {
  const { ...rest } = props;
  return <StyledContextMenu {...rest} />;
};

As this wraps the component I need to re-expose the Props. Right now this isn't possible as they're not exposed through the library.