Skip to content

Instantly share code, notes, and snippets.

@alexaivars
Created October 15, 2020 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexaivars/b0e380bbc8a25d12afa45852fe67fdff to your computer and use it in GitHub Desktop.
Save alexaivars/b0e380bbc8a25d12afa45852fe67fdff to your computer and use it in GitHub Desktop.
type ComponentProps = { text: string } & Pick<React.HTMLAttributes<HTMLDivElement>, 'className' | 'onClick'>;
const Component: React.FunctionComponent<ComponentProps> = ({
text = 'default',
...props
}) => (
<div className={className} {...props}>
{text}
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment