Fix Fast Refresh in <Text> files (#6609)

* Separate non-components from components

* Mark old Text as deprecated

* Move emoji utilities to non-React file

* Fix type

* Fix import
This commit is contained in:
dan
2024-11-21 20:44:40 +00:00
committed by GitHub
parent ff23ddb556
commit cc60566cde
6 changed files with 156 additions and 139 deletions
+6 -2
View File
@@ -12,7 +12,7 @@ import {
childIsString,
renderChildrenWithEmoji,
StringChild,
} from '#/components/Typography'
} from '#/alf/typography'
import {IS_DEV} from '#/env'
export type CustomTextProps = Omit<TextProps, 'children'> & {
@@ -32,7 +32,11 @@ export type CustomTextProps = Omit<TextProps, 'children'> & {
}
)
export function Text({
export {Text_DEPRECATED as Text}
/**
* @deprecated use Text from Typography instead.
*/
function Text_DEPRECATED({
type = 'md',
children,
emoji,