Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3.  
  4. import DynamicImportWrapper from './_DynamicImportWrapper';
  5.  
  6. const propTypes = {
  7. /**
  8. * The content to be placed within the main content area of the container.
  9. */
  10. content: PropTypes.func,
  11. /**
  12. * The props to be applied to the content.
  13. */
  14. // eslint-disable-next-line react/forbid-prop-types
  15. props: PropTypes.object,
  16. };
  17.  
  18. const defaultProps = {
  19. content: undefined,
  20. props: undefined,
  21. };
  22.  
  23. const ContentWrapper = ({ content, props }) => (
  24. <DynamicImportWrapper
  25. content={content}
  26. render={Content => <Content {...props} />}
  27. />
  28. );
  29. ContentWrapper.propTypes = propTypes;
  30. ContentWrapper.defaultProps = defaultProps;
  31. export default ContentWrapper;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement