@jlongster Lifecycle methods still work in React and it’s okay to run procedural logic when your DOM changes. if React ever changes that, then it’s time to jump ship.
You don’t even need to use their state management.
@mjackson Here's an example component from our codebase. We started using React in 2018 and never moved to hooks, effects, any of the new stuff. The old patterns are better, esp. for object oriented code.
this.refresh() == forceUpdate()
https://t.co/Cb5x4MPRuo
@mjackson We use class components. A given component stores its own state as regular instance variables. It can access global state via singleton pattern and can listen for state changes in the data model. It can explicitly render itself (and only itself) when needed.
@mjackson Good thing about react is you can just skip the parts you don’t like. You’re not forced to use their state at all. We forceUpdate() everything on our own schedule.
@nstfkc@mjackson Use Typescript and an object oriented approach. React is only your rendering library. Data/state live on classes, either Singletons or business model instance objects. The view layer uses React but ignores their state management and explicitly calls render() when needed.
@mjackson Been using React for my cross platform
medical simulation for the last 8 years.
We tossed setState early and never touched hooks.
We use class components, lifecycle methods, instance variables and simply forceUpdate explicitly. Works great—only render when needed.
@craigzLiszt I've built the #1 medical simulation app with only one other dev. 98% Typescript plus thin native shells in Swift and Java. Backend all Typescript.
You can see massive efficiency having the same language on client and server.
@DocDifferently Agree wholeheartedly—but all the same, please most of you keep being doctors. We need you.
The onus is upon society & system to do a better job making you want to stay in clinical medicine.
#medtwitter, have you seen our new #Pediatrics Emergency Department?
*6 Brand New Pediatric Cases*
*A new pediatric examination room*
*New infant and toddler models*
*Tons of other updates*
Play now online or download on the Apple or Google App Store!
https://t.co/fh32yO7Wx8