index.tsx 618 B

1234567891011121314151617181920
  1. import {cloneElement, isValidElement} from 'react';
  2. import {RouteComponentProps} from 'react-router';
  3. import {Organization, Project} from 'sentry/types';
  4. import withOrganization from 'sentry/utils/withOrganization';
  5. type Props = RouteComponentProps<{}, {}> & {
  6. children: React.ReactNode;
  7. organization: Organization;
  8. project: Project;
  9. };
  10. function ProjectSourceMapsContainer(props: Props) {
  11. const {children, organization, project} = props;
  12. return isValidElement(children)
  13. ? cloneElement<any>(children, {organization, project})
  14. : null;
  15. }
  16. export default withOrganization(ProjectSourceMapsContainer);