Dynamic data from React state in Mention #3648
-
Hi, I have dynamic data (from an API with TanStack Query) that is being used to populate the Mention suggestion items. I realized that the items function seems to capture the variables on initialization and disregards any updated data from the state. I'm unsure how to accomplish this while using TanStack Query as it auto-manages the state of the API call's response (or with any kind of state variable) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Seems like I have found how to accomplish this - |
Beta Was this translation helpful? Give feedback.
-
Thanks! turns out the reason I was so confused is because I am using Vue. I ended up getting this to work in Vue using provide/inject Some more info here for anyone else on the same path: |
Beta Was this translation helpful? Give feedback.
Seems like I have found how to accomplish this -
useEditor
has a dependency array which can be utilized to update the editor on state/prop change. I only needed to add the state to that array