react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

doesn't work for Next 15/React 19?

Open ohitsdoh opened this issue 1 year ago • 13 comments

Steps to reproduce:

  1. Upgrade to Next 15

Expected behaviour: It to render

Observed behaviour: Getting the following error:

image

ohitsdoh avatar Nov 27 '24 23:11 ohitsdoh

Having the same issue with the react 19 production release

apeiniger avatar Dec 09 '24 08:12 apeiniger

Hi, I also experienced the same thing and as it seems this library is silently disontinued I took the initiative to fix it for myself.

Currently you can check the code here (https://github.com/moxylabs/react-mentions/tree/v4.6.0) and use it like this in package.json "react-mentions": "github:moxylabs/react-mentions#v4.6.0"

You can give it a try and let me know if it's fixed for you. Works in my use case but I can't guarantee it's fixed for all

If someone needs any feature in the other pull requests here merged I can do that in the repo above. If someone wants to convert it to TS or rewrite the class components to functonal components ... let's do this. I'm kinda ready to adopt it as it's easier for me than to switch to another lib

zapbulon avatar Dec 11 '24 11:12 zapbulon

@zapbulon This worked for my team. We just implemented this library a few weeks ago, so much appreciated!!

isaacrmoreno avatar Dec 11 '24 18:12 isaacrmoreno

@zapbulon Thanks, that works, nice šŸ‘

Only thing is I'm still getting errors when checking for typescript errors:

CleanShot 2024-12-14 at 12 43 10@2x

Are you still seeing the errors there?

apeiniger avatar Dec 14 '24 11:12 apeiniger

@zapbulon Thanks, that works, nice šŸ‘

Only thing is I'm still getting errors when checking for typescript errors:

CleanShot 2024-12-14 at 12 43 10@2x

Are you still seeing the errors there?

Unfortunately I have no idea what ReactPortal is and my best guess is it's something custom to yopur project? I'm not sure why it requires children prop

zapbulon avatar Dec 14 '24 14:12 zapbulon

Hi, I also experienced the same thing and as it seems this library is silently disontinued I took the initiative to fix it for myself.

Currently you can check the code here (https://github.com/moxylabs/react-mentions/tree/v4.6.0) and use it like this in package.json "react-mentions": "github:moxylabs/react-mentions#v4.6.0"

You can give it a try and let me know if it's fixed for you. Works in my use case but I can't guarantee it's fixed for all

If someone needs any feature in the other pull requests here merged I can do that in the repo above. If someone wants to convert it to TS or rewrite the class components to functonal components ... let's do this. I'm kinda ready to adopt it as it's easier for me than to switch to another lib

Legend!!! Any chance you can publish this? I’m in on working on it and maintaining. Let me know what you think.

olabayojiwaddle avatar Jan 23 '25 12:01 olabayojiwaddle

@zapbulon , thank you! +1 to what @olabayojiwaddle said above as well..

sternma avatar Jan 27 '25 20:01 sternma

@apeiniger we had similar issues and resolved it with

  "resolutions": {
    "@types/react": "19.0.10",
    "@types/react-dom": "19.0.4"
  },

in package.json. @zapbulon 's fork is still needed though because otherwise it just crashes in runtime

bel0v avatar Mar 05 '25 17:03 bel0v

Hi, it works for me. You need to set the markup (for example : markup='@display') on the Mention component.

maraism avatar Apr 10 '25 09:04 maraism

@zapbulon many thanks for this fix. I had spent hours trying to understand why my code was not working.

eliezerbs9 avatar May 30 '25 17:05 eliezerbs9

Hey folks, I got it working with React 19 and migrated the unit tests from Enzyme to React Testing Library. Also included a few minor bug fixes: https://github.com/asumaran/react-mentions/releases/tag/v4.7.0

Similar to @zapbulon you can use my fork with:

"react-mentions": "github:asumaran/react-mentions#v4.7.0",

asumaran avatar Jun 14 '25 04:06 asumaran

Uncaught TypeError: Cannot read properties of null (reading 'length') I got this issue. Image

marklin49 avatar Aug 19 '25 15:08 marklin49

This package looks abandon but I am working to resurrect with a modern rewrite. Fully rewritten for React 19 in TypeScript. You can try it today (but it's not šŸ’Æ and I'm still evolving it): https://github.com/hbmartin/react-mentions-ts

hbmartin avatar Oct 16 '25 02:10 hbmartin