Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-codegen

Package Overview
Dependencies
Maintainers
11
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-codegen

⚛️ Code generation tools for React Native

  • 0.70.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
408K
decreased by-25.31%
Maintainers
11
Weekly downloads
 
Created

What is react-native-codegen?

The react-native-codegen package is a tool used in the React Native ecosystem to generate native code for JavaScript components and modules. It helps in creating type-safe interfaces between JavaScript and native code, ensuring that the data passed between them is correctly typed and validated.

What are react-native-codegen's main functionalities?

Generating Native Modules

This feature allows you to define a native module in a JSON format, which react-native-codegen will then use to generate the corresponding native code. This ensures type safety and consistency between JavaScript and native code.

```json
{
  "name": "MyModule",
  "type": "module",
  "methods": {
    "myMethod": {
      "type": "function",
      "params": [
        { "name": "param1", "type": "string" },
        { "name": "param2", "type": "number" }
      ],
      "returnType": "void"
    }
  }
}
```

Generating Native Components

This feature allows you to define a native component in a JSON format, which react-native-codegen will then use to generate the corresponding native code. This ensures that the component's props are correctly typed and validated.

```json
{
  "name": "MyComponent",
  "type": "component",
  "props": {
    "title": { "type": "string" },
    "count": { "type": "number" }
  }
}
```

Generating Event Emitters

This feature allows you to define an event emitter in a JSON format, which react-native-codegen will then use to generate the corresponding native code. This ensures that the events and their data are correctly typed and validated.

```json
{
  "name": "MyEventEmitter",
  "type": "eventEmitter",
  "events": {
    "onEvent": {
      "type": "function",
      "params": [
        { "name": "eventData", "type": "object" }
      ]
    }
  }
}
```

Other packages similar to react-native-codegen

FAQs

Package last updated on 12 Oct 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc