HomePhabricator
Diffusion Comm e87f9df936e2

[native] Compute typeahead suggestions and matched strings outside the class…

Description

[native] Compute typeahead suggestions and matched strings outside the class component

Summary:
In order to use a hook that will get user mention candidates that are resolved, we need to first extract the logic to compute user chat mention candidates outside of the class component. There are two steps to this:

  1. Lift the selectionState out of the class component
  2. Move the computation logic out of the class component

This diff just covers step 2. We should now be able to refactor getMentionTypeaheadUserSuggestions into a hook that will allow for @ mentioning ENS users by their name.

Addresses https://linear.app/comm/issue/ENG-6112/update-native-chat-input-bar-to-make-it-easier-to-use-hooks

Depends on D10385

Test Plan: Once again confirmed that there were no regressions introduced by this changed. I also added some console.log statements for suggestions both off master and this diff, and made sure that I didn't notice any additional re-renderings caused by this change.

Reviewers: atul, ginsu, inka

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D10386

Details

Provenance
rohanAuthored on Dec 19 2023, 6:50 AM
Reviewer
atul
Differential Revision
D10386: [native] Compute typeahead suggestions and matched strings outside the class component
Parents
rCOMM5361aca8bd01: [native] Lift selectionState in chat input bar
Branches
Unknown
Tags
Unknown