Skip to content

fix: Removed @emoji-mart/react dependency #1484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged

Conversation

matthewlipski
Copy link
Collaborator

@emoji-mart/react is not compatible with React 19 and is only one file, so this PR changes it from a dependency to just a copy of the file

Copy link

vercel bot commented Mar 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Mar 4, 2025 1:21pm
blocknote-website ✅ Ready (Inspect) Visit Preview Mar 4, 2025 1:21pm

@@ -0,0 +1,23 @@
// From https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart-react/react.tsx
import React, { useEffect, useRef } from "react";
import { Picker } from "emoji-mart";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this include the whole bundle of emoji mart data? Or is that separate?

Do we need this as a dynamic import?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so, iirc from doing manual testing the emojis are fetched on initial render. Diving into the source code seems to support this:

https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart/src/components/Picker/Picker.tsx#L112

The _init gets called in the Picker component's componentWillReceiveProps function, so either way it's not until the first render.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, cool, wasn't aware of how it works

@nperez0111 nperez0111 merged commit 0e574a4 into main Mar 4, 2025
7 checks passed
@nperez0111 nperez0111 deleted the emoji-mart-react-dep branch March 4, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants