Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You don't have to use their hooks! Looking at your pastebin link, I would probably opt for something like a factory pattern instead: https://pastebin.com/PbnBqX4a

Just because you're in React land doesn't mean you can't still write regular old js/ts and hook in only when you need it. I imagine you'd do something quite similar in any other framework.



I appreciate your example.

Some libs do not expose "vanilla" js/ts functions that I can call - e.g. `LiveKitRoom` https://github.com/livekit/client-sdk-react-native

It only takes 1 hook to pollute your entire factory pattern; the comparison to colored async functions wasn't spurious. Hook-only options seem especially prevalent in the React Native ecosystem (ironic, given the memory constraints of phones).

Of course, I could fork/go down to the native layer, but this just proves my point that React DX is hot garbage.


You can't use their js sdk? https://github.com/livekit/client-sdk-js


No, sadly. I use some features that require the usage of native code, e.g. native echo cancellation, foreground service to keep the audio running when the screen is off, etc. The sdk-js is meant for browsers.


Gotcha. I'm unfamiliar with LiveKit and React native so appreciate your clarifications. You've convinced me that your grievances are legit haha.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: