4 ms·
React is fine, but what is going on with RTK? So. Much. Boilerplate.
by lakpan 3y ago
React is fine, but what is going on with RTK? So. Much. Boilerplate.
- acemarke 3y agoHi, I'm a Redux maintainer. I'm kind of confused by your comment in a couple ways. I'm not sure why you're jumping to discussing Redux here - we're a completely separate project from React, and nothing about the parent comment mentioned Redux. That said, we specifically created and designed RTK to _eliminate_ boilerplate, so I'm not sure what "boilerplate" you're referring to here. Could you give some specific examples? What concerns do you have?
- lakpan 3y agoI’m neither a React nor Redux developer, but I work on React codebases. The code I see for simple changes is super verbose compared to what it would look like with simple hooks. I don’t know if it’s just my coworkers that suck at it.
- acemarke 3y agoRedux will never be the _absolute_ shortest way to write updates - it intentionally adds a level of indirection (the concept of "dispatching actions"). That said, we specifically created Redux Toolkit to drastically simplify standard Redux usage patterns. Sadly, despite it being the default way to write Redux apps for several years now, there's still a lot of legacy Redux code that isn't following our recommended patterns. See our "Migrating to Modern Redux" guide for details: - https://redux.js.org/usage/migrating-to-modern-redux https://redux.js.org/usage/migrating-to-modern-redux as well as the "Style Guide" best practices page: - https://redux.js.org/style-guide/ https://redux.js.org/style-guide/