1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-17 16:45:49 +07:00

fix: typography Component - Introduced ForwardRef (#179)

* refactor: introduced forwardref

* refacttor: updated ref's

* fix: fixed func's name

* fix: fixed snapshots

* fix: updated snap
This commit is contained in:
Priscila Oliveira
2019-10-12 21:41:42 +02:00
committed by Juan Picado @jotadeveloper
parent 82d7107de7
commit a8deeb9b9d
34 changed files with 262 additions and 183 deletions

View File

@@ -0,0 +1,19 @@
import React, { forwardRef } from 'react';
import { default as MaterialUITypography, TypographyProps } from '@material-ui/core/Typography';
type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
type HeadingRef = HeadingType;
interface Props extends Omit<TypographyProps, 'variant'> {
variant?: HeadingType;
}
const Heading = forwardRef<HeadingRef, Props>(function Heading(props, ref) {
return <MaterialUITypography {...props} ref={ref} />;
});
Heading.defaultProps = {
variant: 'h6',
};
export default Heading;

View File

@@ -0,0 +1 @@
export { default } from './Heading';