{"library":"react-native-web","title":"React Native for Web","description":"React Native for Web is a library that enables developers to run React Native components and APIs directly on the web using React DOM. It aims to maximize code reuse between native mobile and web platforms, providing a unified API surface that abstracts away platform-specific implementation details. The current stable version is 0.21.2, with minor releases occurring relatively frequently, indicating active development. Key differentiators include its ability to directly interpret React Native's styling system (Yoga layout), accessibility APIs, and core components for web rendering, thereby allowing a single codebase to target multiple platforms, distinct from approaches that require separate web components or extensive platform-specific logic.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-native-web"],"cli":null},"imports":["import { View, Text, StyleSheet } from 'react-native';","import { AppRegistry } from 'react-native';","import { Platform } from 'react-native';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport { AppRegistry, StyleSheet, Text, View } from 'react-native';\n\nclass App extends React.Component {\n  render() {\n    return (\n      <View style={styles.box}>\n        <Text style={styles.text}>Hello, world!</Text>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  box: { padding: 10 },\n  text: { fontWeight: 'bold' }\n});\n\nAppRegistry.registerComponent('App', () => App);\nAppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') });","lang":"javascript","description":"This quickstart demonstrates a basic React Native component rendered on the web using React Native for Web, including component registration and rendering to a specified DOM element.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}