Home Code First-class Support for TypeScript · React Native

First-class Support for TypeScript · React Native

by TM

With the release of React Native 0.71, there are several changes that are aimed at improving the TypeScript experience. One major change is that when creating a new React Native app using the React Native CLI, the default template will now be in TypeScript (App.tsx) instead of JavaScript (App.js). The new project will also be set up with a tsconfig.json file, making it easier to write typed code from the start. Additionally, TypeScript declarations are now shipped with React Native itself, whereas previously they were provided by @types/react-native in the DefinitelyTyped repository. This change improves correctness and maintenance, as types can now be more closely aligned with the React Native source code. As a result, users no longer need to manage @types/react-native as a dependency when upgrading to React Native 0.71 or above. The plan is to deprecate @types/react-native for versions 0.73 and onward. Instructions are provided for migrating to the new co-located types. Lastly, Flow users can still typecheck applications targeting 0.71+, but the configuration logic is no longer included by default in the template.

Source link

You may also like

Leave a Comment

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00