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,
});
if (emojifiedHtml === null) {
return null;
}
return (
<Wrapper
{...props}

View File

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