Upgrading to React 18 with TypeScript
Blog post from LogRocket
React 18's release on March 29, 2022, brought significant breaking changes to type definitions, necessitating updates to projects using TypeScript. The type definitions for React 18 were made possible through the Definitely Typed repository, largely thanks to the efforts of Sebastian Silbermann. These changes, which included the removal of implicit children and other deprecated types, led to potential breakages in existing codebases. To manage this transition, developers can employ Sebastian's codemod, specifically designed to automate the process of updating codebases to accommodate the new type definitions. The article also highlights the challenges faced due to Definitely Typed's versioning system, which does not support semantic versioning, and how this impacts the consumption of type definitions. Through a practical example of upgrading a simple website, developers are guided on how to effectively navigate these changes using tools like codemods and ProperWithChildren.