index.tsx 573 B

12345678910111213141516171819202122232425262728293031
  1. import React, { forwardRef } from 'react';
  2. import { Wrapper } from './styled';
  3. type Props = {
  4. onBlur: () => void;
  5. onMouseDown: () => void;
  6. onMouseOver: () => void;
  7. onMouseOut: () => void;
  8. onKeyDown: (e: React.KeyboardEvent) => void;
  9. children: React.ReactNode;
  10. };
  11. type Ref = HTMLDivElement;
  12. const index = forwardRef<Ref, Props>(({
  13. children,
  14. ...rest
  15. }: Props, ref) => (
  16. <Wrapper
  17. ref={ref}
  18. tabIndex={0}
  19. role="button"
  20. onFocus={(): void => { console.log('focus'); }}
  21. {...rest}
  22. >
  23. {children}
  24. </Wrapper>
  25. ));
  26. export default index;