dabakovich / react-native-controlled-mentions

Fully controlled React Native mentions component
MIT License
223 stars 82 forks source link

Providing a context provider #101

Closed matinzd closed 1 year ago

matinzd commented 2 years ago

I think it can be a good idea to provide a context provider in order to move suggestion rendering out of the container itself. Imagine you are having a comment input and a send button next to it. For example:

Screenshot 2022-09-02 at 15 28 00
fukemy commented 2 years ago

why not use scrollView?

matinzd commented 2 years ago

why not use scrollView?

What do you mean?

fukemy commented 2 years ago

i think better is keep rendering view inside mentionView better(avoid memories, better handling). And you can wrap the mentionView by scrollView + give maxheight to it.

But for your issues, you can refer to v3 alpha then look how it work

matinzd commented 2 years ago

i think better is keep rendering view inside mentionView better(avoid memories, better handling). And you can wrap the mentionView by scrollView + give maxheight to it.

But for your issues, you can refer to v3 alpha then look how it work

I mean we can move rendering the whole list out of component and have some kind of context to get the render suggestions. I may send a PR for my proposal.

fukemy commented 2 years ago

Please double check the v3-alpha, he did all your purpose.

  1. No need to use MentionInput directly
  2. Keep track to mentions suggest
  3. Render mention view in every place you want
fukemy commented 2 years ago

https://github.com/dabakovich/react-native-controlled-mentions/issues/75#issuecomment-1114282123

matinzd commented 2 years ago

75 (comment)

Nice! I didn’t see that. That is what I wanted :)

dabakovich commented 1 year ago

Closing the issue as it seems that v3 resolves the issues described here.