Combination.tsx 550 B

123456789101112131415161718192021222324252627
  1. import React from 'react';
  2. import { RouteProps } from '../@types';
  3. import SubHead from './SubHead'
  4. interface Props extends RouteProps {
  5. layer: any,
  6. currentRoute?: Function
  7. }
  8. function Combination(props: Props) {
  9. let args = {...props}
  10. let Layer = args.layer
  11. let cls = args.className
  12. delete args.layer
  13. delete args.className
  14. delete args.currentRoute
  15. props.currentRoute && props.currentRoute(props)
  16. return (
  17. <div className={cls}>
  18. <SubHead {...args} />
  19. <Layer {...args} />
  20. </div>
  21. )
  22. }
  23. export default Combination