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
@@ -31,7 +31,7 @@ import {
suggestLinkCardUri,
} from '#/view/com/composer/text-input/text-input-util'
import {atoms as a, useAlf} from '#/alf'
import {normalizeTextStyles} from '#/components/Typography'
import {normalizeTextStyles} from '#/alf/typography'
import {Autocomplete} from './mobile/Autocomplete'
export interface TextInputRef {
@@ -23,8 +23,8 @@ import {
} from '#/view/com/composer/text-input/text-input-util'
import {textInputWebEmitter} from '#/view/com/composer/text-input/textInputWebEmitter'
import {atoms as a, useAlf} from '#/alf'
import {normalizeTextStyles} from '#/alf/typography'
import {Portal} from '#/components/Portal'
import {normalizeTextStyles} from '#/components/Typography'
import {Text} from '../../util/text/Text'
import {createSuggestion} from './web/Autocomplete'
import {Emoji} from './web/EmojiPicker.web'
+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,