2019-10-13 02:41:42 +07:00
|
|
|
import React, { forwardRef } from 'react';
|
2020-01-14 13:43:31 +07:00
|
|
|
import { default as MaterialUITypography } from '@material-ui/core/Typography';
|
2019-10-13 02:41:42 +07:00
|
|
|
|
2020-01-14 13:43:31 +07:00
|
|
|
import { TextProps } from './TextConfig';
|
2019-10-13 02:41:42 +07:00
|
|
|
|
2020-01-14 13:43:31 +07:00
|
|
|
type TextRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
2019-10-13 02:41:42 +07:00
|
|
|
|
|
|
|
// The reference is already from type of the Component, so the any below is not a problem
|
2019-10-31 14:12:18 +07:00
|
|
|
const Text = forwardRef<TextRef, TextProps>(function Text(props, ref) {
|
2019-10-13 02:41:42 +07:00
|
|
|
return <MaterialUITypography {...props} ref={ref} />;
|
|
|
|
});
|
|
|
|
|
|
|
|
Text.defaultProps = {
|
|
|
|
variant: 'subtitle1',
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Text;
|