{"repo":"wantedly/react-declassify","free":true,"listed":false,"github":"https://github.com/wantedly/react-declassify","clone":"git clone https://github.com/wantedly/react-declassify.git","description":"say goodbye to class components","language":"TypeScript","stars":98,"topics":["automation","babel","codemod","react","reacthooks"],"license":null,"category":"workflow-automation","readme_excerpt":"react-declassify: say goodbye to class components This codemod automatically transforms React class components into React functional components using Hooks for you! Before After ---------------------------------------------- -------------------------------------------- Features - ✅ Supports props, states, methods, and refs. - ✅ Comments, spaces, and styles are preserved thanks to the recast library. - ✅ Designed to generate as idiomatic code as possible. Not something Babel or Webpack would generate! - ✅ Based on classical heuristic automation; no need to be fearful about whimsy LLMs. Why do we need this? Class components are still going to be supported by React for the foreseeable future. However, it is no longer recommended to write new components in class-style. So what about the existing components? Although React will continue to support these, you may struggle to maintain them because: - New libraries and new versions of existing libraries tend to focus on Hooks-style components, and you may find you in a difficulty adopting the components to the libraries. - Class components may appear alien to those who are young in React development experience. Thus it is still a good idea to migrate from class components to Hooks-based components. However, as this is not a simple syntactic change, migration needs a careful hand work and a careful review. This tool is a classic automation, it reduces a risk of introducing human errors during migration. Usage then Example Before: Afte","default_branch":null,"files":null,"tree":[],"storefront":"/r/wantedly","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wantedly/react-declassify/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}