Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@types/react-native
Advanced tools
The @types/react-native package provides TypeScript type definitions for React Native. This allows developers to use TypeScript's static typing features when developing React Native applications, which can help catch errors at compile time, provide better tooling support, and improve the development experience.
Component Typing
Provides type definitions for React Native components, allowing for type-checked props and state.
import { View, Text } from 'react-native';
interface Props {
title: string;
}
const MyComponent: React.FC<Props> = ({ title }) => (
<View>
<Text>{title}</Text>
</View>
);
API Typing
Includes type definitions for React Native APIs, ensuring that the correct types are used for API parameters and return values.
import { Alert } from 'react-native';
Alert.alert('Title', 'Message', [
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: () => console.log('OK Pressed')},
]);
Event Typing
Provides types for event handlers and events, allowing developers to handle events with type safety.
import { TouchableOpacity } from 'react-native';
const MyButton: React.FC = () => (
<TouchableOpacity onPress={(event) => console.log(event.nativeEvent)}>
<Text>Press Me</Text>
</TouchableOpacity>
);
This package contains type definitions for React. It's similar to @types/react-native but is used for web applications built with React rather than mobile applications built with React Native.
This package is a TypeScript transformer for React Native, allowing developers to write their React Native app in TypeScript. It differs from @types/react-native in that it's a build tool rather than a type definition package.
This package generates TypeScript and Flow types for native modules and view managers automatically. It's different from @types/react-native as it focuses on bridging native code with TypeScript rather than providing type definitions for existing React Native APIs.
npm install --save @types/react-native
This package contains type definitions for react-native (https://github.com/facebook/react-native).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native.
AbortController
, AbortSignal
, Blob
, FileReader
, FormData
, Headers
, MessageQueue
, Request
, Response
, URL
, URLSearchParams
, WebSocket
, XMLHttpRequest
, XMLHttpRequestUpload
, cancelAnimationFrame
, clearImmediate
, clearInterval
, clearTimeout
, fetch
, fetchBundle
, requestAnimationFrame
, setImmediate
, setInterval
, setTimeout
These definitions were written by Eloy Durán, HuHuanming, Kyle Roach, Tim Wang, Kamal Mahyuddin, Alex Dunne, Manuel Alabor, Michele Bombardi, Martin van Dam, Kacper Wiszczuk, Ryan Nickel, Souvik Ghosh, Cheng Gibson, Saransh Kataria, Wojciech Tyczynski, Jake Bloom, Ceyhun Ozugur, Mike Martin, Theo Henry de Villeneuve, Romain Faust, Be Birchall, Jesse Katsumata, Xianming Zhong, Valentyn Tolochko, Sergey Sychev, Kelvin Chu, Daiki Ihara, Abe Dolinger, Dominique Richard, Mohamed Shaban, Jérémy Barbet, David Sheldrick, Natsathorn Yuthakovit, ConnectDotz, Alexey Molchan, Alex Brazier, Arafat Zahan, Pedro Hernández, Sebastian Silbermann, Zihan Chen, Lorenzo Sciandra, and Mateusz Wit.
FAQs
Stub TypeScript definitions entry for react-native, which provides its own types definitions
We found that @types/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.