df pfp
df
@df
Farcaster react native experts - what's the best way to do a text area with things like @ mentions (think a Casting input). Are there any serious problems with using a webview?
3 replies
0 recast
0 reaction

Varun Srinivasan pfp
Varun Srinivasan
@v
Cc @nickcherry
1 reply
0 recast
0 reaction

Nick Cherry pfp
Nick Cherry
@nickcherry
I haven't built it out to verify, but I would expect rendering several webviews (e.g. one for each cast in a feed) would be pretty expensive from a CPU/memory perspective, since you're effectively spinning up a dozen little mobile Safari browsers. That would be less of a problem if you're only using it for one view,
1 reply
0 recast
0 reaction

Nick Cherry pfp
Nick Cherry
@nickcherry
but at a minimum it will add some awkwardness to your code, since you'll have native Javascript + Javascript that gets injected into the web view, which will either mean you'll give up type safety, auto-complete, etc. or you'll need to setup a whole separate build process to compile the webview Javascript.
1 reply
0 recast
0 reaction

Nick Cherry pfp
Nick Cherry
@nickcherry
For rich text, we use a library called linkify-it, which assists with the tokenization, then we we join those tokens, wrapping segments with native components (e.g. View, Text, etc.). I'm not a big fan of the linkify-it library, because I think the interface is awkward and unintuitive,
1 reply
0 recast
0 reaction