Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Love Letter to React Native (stopa.io)
2 points by stopachka on Dec 6, 2021 | hide | past | favorite | 1 comment


That's funny because I don't like react native at all. Facebook, in their infinite wisdom, created a library that erases all your variables on every render. So instead of using the language, let's have an abstraction for the most fundamental thing a language does. Oh, but that doesn't work because prop drilling becomes a major issue for all but the most trivial applications.

Not to worry, just use a pseudo state machine with random conventions around naming and architecture and you will finally be able to assign variables. You will have to relearn asynchronous code and derived data. Transient data is unsupported and you'll have to figure out your own solution for any fast-changing variables. These variables will be incompatible with the variables you use for animation. That's because react shoehorns declarative and functional paradigms into a language that isn't designed for it. That's okay though, the animated api can simply have a convoluted way of accessing and interpolating values in an imperative way that is incompatible with the aforementioned paradigms.

Okay so we learned how to set variables. Now let's change how you write classes. As we all know OOP is the devil so let's replace it with something that is harder to understand. Juggle your refs, effects, and memos around and everything will begin to make more sense. Lifecycle methods weren't intuitive but now you will understand that behaviour is best represented by a function and an array passed to a black-box function that returns another function for cleanup.

I could go on but I have to finish my custom implementation of multitouch because Facebook didn't think to include that in a library designed for multitouch devices.




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

Search: