5 ms·
Fun fact: I started building a couple React apps 5 years ago. Apps still run, but since they're class based component and don't use hooks, the apps feel like an
by neals 5y ago
Fun fact: I started building a couple React apps 5 years ago. Apps still run, but since they're class based component and don't use hooks, the apps feel like ancient. They run perfectly fine though. New guys don't really want to work on in though. Hooray for progress.
- goodoldneon 5y agoIf you'd like to migrate them, the React team maintains some awesome codemods: https://github.com/reactjs/react-codemod https://github.com/reactjs/react-codemod
- Beowolve 5y agoI still wish they maintained ESLint rules to help auto fix things instead of codemods.
- deleted 5y ago[deleted]
- zdragnar 5y agoFun fact: very few developers (especially newbies) enjoy working on legacy projects. New features push the business forward, lets you learn faster, you aren't constrained by the garbage someone else wrote years ago but don't have the budget to change, and it looks better on a resume in an industry where the average term of employment is 2 years because new hires get bigger pay bumps than annual raises give.
- deleted 5y ago[deleted]
- TurningCanadian 5y agoFYI IntelliJ/WebStorm has a refactor option that automatically converts class-based components to hooks and vice-versa.
- crummy 5y agoDoes it? I know it can go hooks -> class but haven't been able to get it to work the other way around. edit: You can go both ways, if your class component is simple enough.
- ab-dm 5y agoSame. Every time a new version gets released I feel a pang of guilt for that poor codebase, but it's been jogging along for 5-6 years with minimal updates and it works like a charm. Fairly big code base as well. I did upgrade from react-router v1 though... declaring routes as JSON just felt a bit too gross.
- franciscop 5y agoFor few hundred $ you can get that converted to hooks, depending on the app complexity. I'd offer it myself if I didn't have a fulltime job currently.