![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
react-native-tscodegen
Advanced tools
This library enable people to write react-native Turbo Module in TypeScript, and generate native code in C++, Objective C++ and Java!
0.70.1
At this moment, the new Turbo Module API is not published by Facebook,
you need npm package react-native-tscodegen-types
to access these new APIs.
Here is an example of a very simple Turbo Module TypeScript file: ./src/turboModule.ts
.
import { TurboModule, TurboModuleRegistry } from 'react-native-tscodegen-types';
export interface Spec extends TurboModule {
getHello(name: string): string;
}
// tslint:disable-next-line
export default (TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule') as Spec);
In order to do code generation, you need an extra JSON file for this TypeScript file. They are one-to-one mapping for now, if you have multiple TypeScript files, you need multiple JSON files This will be improved in the future.
Name the following file as react-native-tscodegen.json
{
"libraryName": "PlaygroundModule",
"outputDirectory": "./lib/cpp-generated",
"moduleSpecName": "PlaygroundModuleSpec",
"generators": [
"descriptors",
"events",
"props",
"tests",
"shadow-nodes",
"modulesAndroid",
"modulesCxx",
"modulesIOS"
],
"inputFile": "./src/turboModule.ts"
}
And add this script to your package.json
{
"scripts": {
"codegen": "react-native-tscodegen ./react-native-tscodegen.json"
}
}
After running npm run codegen
, you will see files get generated in ./lib/cpp-generated
.
You are expected to use react-native-windows for implementing turbo modules in C++.
FAQs
TypeScript Code Generation for React Native Turbo Module
We found that react-native-tscodegen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.