remove null from emojifiedtext state

This commit is contained in:
ChaosExAnima 2025-09-09 15:48:32 +02:00
parent 6a23cd26fc
commit 1d9a5e4abd
No known key found for this signature in database
GPG Key ID: 8F2B333100FB6117
2 changed files with 2 additions and 5 deletions

View File

@ -32,10 +32,6 @@ export const ModernEmojiHTML = ({
deep: !shallow, deep: !shallow,
}); });
if (emojifiedHtml === null) {
return null;
}
return ( return (
<Wrapper <Wrapper
{...props} {...props}

View File

@ -26,7 +26,7 @@ export function useEmojify({
extraEmojis, extraEmojis,
deep = true, deep = true,
}: UseEmojifyOptions) { }: UseEmojifyOptions) {
const [emojifiedText, setEmojifiedText] = useState<string | null>(null); const [emojifiedText, setEmojifiedText] = useState(text);
const appState = useEmojiAppState(); const appState = useEmojiAppState();
const extra: ExtraCustomEmojiMap = useMemo(() => { const extra: ExtraCustomEmojiMap = useMemo(() => {
@ -55,6 +55,7 @@ export function useEmojify({
}, },
[appState, deep, extra], [appState, deep, extra],
); );
useLayoutEffect(() => { useLayoutEffect(() => {
if (isModernEmojiEnabled() && !!text.trim()) { if (isModernEmojiEnabled() && !!text.trim()) {
const result = emojify(text); const result = emojify(text);