Skip to content

Instantly share code, notes, and snippets.

@isabellachen
Created February 21, 2020 14:03
Show Gist options
  • Save isabellachen/3c448133f411f30b32a0e1a5d4b77428 to your computer and use it in GitHub Desktop.
Save isabellachen/3c448133f411f30b32a0e1a5d4b77428 to your computer and use it in GitHub Desktop.
generic component props
import { PropsWithChildren } from 'react';
export type GenericComponentProps = PropsWithChildren<Record<string, any>>;
const MetaBox = (props: GenericComponentProps) => (
<div className="metainfo__box">
<div>{t(`entityDetail.${props.label}`)}</div>
<div>{props.children}</div>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment