Convert Figma logo to code with AI

reactwg logoreact-native-new-architecture

Workgroup for the New React Native Architecture

1,385
34
1,385
0

Top Related Projects

A framework for building native applications using React

Material Design for React Native (Android & iOS)

A complete native navigation solution for React Native

2,365

The React Native Community CLI - command line tools to help you build RN apps

17,543

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!

33,519

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

Quick Overview

The reactwg/react-native-new-architecture repository is a working group dedicated to the new architecture of React Native. It serves as a central hub for discussions, proposals, and documentation related to the ongoing efforts to improve React Native's performance, stability, and developer experience through architectural changes.

Pros

  • Provides a collaborative space for the React Native community to contribute to the framework's evolution
  • Offers transparency into the decision-making process for architectural changes
  • Centralizes information and resources about the new architecture, making it easier for developers to stay informed
  • Facilitates faster adoption of new features and improvements in React Native

Cons

  • May be overwhelming for newcomers due to the technical depth of discussions
  • The ongoing nature of the work means that some information may become outdated quickly
  • Implementation details and timelines can be uncertain, potentially causing confusion for developers planning to adopt new features
  • The focus on architectural changes may not directly address all immediate concerns of React Native developers

Getting Started

To get involved with the React Native new architecture working group:

  1. Visit the repository
  2. Read the README and contributing guidelines
  3. Browse open issues and discussions to understand current topics
  4. Join the conversations by commenting on existing issues or creating new ones
  5. Follow the repository to stay updated on new developments

Note: This repository is primarily for discussions and documentation, not a code library. Therefore, code examples and quick start instructions are not applicable.

Competitor Comparisons

A framework for building native applications using React

Pros of React Native

  • Mature and stable framework with a large community and extensive documentation
  • Wide range of third-party libraries and components available
  • Proven track record in production environments for many large-scale applications

Cons of React Native

  • Legacy architecture may lead to performance bottlenecks in complex applications
  • Limited access to native platform features without additional bridging
  • Slower adoption of new iOS and Android platform capabilities

Code Comparison

React Native (Legacy Architecture):

import { NativeModules } from 'react-native';

const { CalendarModule } = NativeModules;
CalendarModule.createCalendarEvent('Meeting', 'Conference Room');

React Native New Architecture:

import { TurboModuleRegistry } from 'react-native';

const CalendarModule = TurboModuleRegistry.get('CalendarModule');
CalendarModule.createCalendarEvent('Meeting', 'Conference Room');

The new architecture introduces TurboModules, which provide a more efficient way to interact with native modules, reducing overhead and improving performance. The syntax remains similar, but the underlying implementation is more optimized.

React Native New Architecture aims to address performance issues, improve integration with native components, and provide a more flexible foundation for future development. However, it's still in development and may lack the maturity and extensive ecosystem support of the original React Native framework.

Material Design for React Native (Android & iOS)

Pros of React Native Paper

  • Comprehensive UI component library specifically designed for React Native
  • Follows Material Design guidelines, ensuring a consistent and modern look
  • Extensive documentation and examples for easy implementation

Cons of React Native Paper

  • Limited to Material Design aesthetics, which may not suit all app designs
  • Potential performance overhead due to additional abstraction layer
  • May require more frequent updates to stay compatible with React Native changes

Code Comparison

React Native Paper:

import { Button } from 'react-native-paper';

const MyComponent = () => (
  <Button mode="contained" onPress={() => console.log('Pressed')}>
    Press me
  </Button>
);

React Native New Architecture:

import { Pressable, Text } from 'react-native';

const MyComponent = () => (
  <Pressable onPress={() => console.log('Pressed')}>
    <Text>Press me</Text>
  </Pressable>
);

React Native Paper provides pre-styled components, while the New Architecture focuses on core functionality and performance improvements. The New Architecture aims to enhance the overall React Native framework, whereas React Native Paper is a UI library built on top of React Native. Developers should consider their specific needs, design requirements, and performance goals when choosing between these options.

A complete native navigation solution for React Native

Pros of react-native-navigation

  • Mature and widely adopted navigation solution with extensive community support
  • Offers native navigation performance and smooth transitions between screens
  • Provides a rich set of customization options for navigation UI elements

Cons of react-native-navigation

  • Steeper learning curve compared to the new architecture's simplified navigation approach
  • May require more setup and configuration, especially for complex navigation scenarios
  • Potential compatibility issues with certain React Native versions or third-party libraries

Code Comparison

react-native-navigation:

Navigation.setRoot({
  root: {
    stack: {
      children: [
        { component: { name: 'Home' } },
        { component: { name: 'Profile' } }
      ]
    }
  }
});

react-native-new-architecture:

import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen name="Home" component={HomeScreen} />
        <Stack.Screen name="Profile" component={ProfileScreen} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

The new architecture's navigation approach offers a more declarative and React-like syntax, while react-native-navigation provides a more imperative API for managing navigation.

2,365

The React Native Community CLI - command line tools to help you build RN apps

Pros of react-native-cli

  • Mature and well-established tool with extensive documentation
  • Broader community support and more frequent updates
  • Integrated with the React Native ecosystem, providing a seamless development experience

Cons of react-native-cli

  • May not include cutting-edge features found in the new architecture
  • Potentially slower performance compared to the new architecture
  • Limited support for newer React Native concepts like Fabric and TurboModules

Code Comparison

react-native-cli:

import { AppRegistry } from 'react-native';
import App from './App';

AppRegistry.registerComponent('MyApp', () => App);

react-native-new-architecture:

import { AppRegistry } from 'react-native';
import App from './App';

AppRegistry.registerComponent('MyApp', () => App);
// Additional configuration for new architecture features

The basic setup remains similar, but react-native-new-architecture may require additional configuration for new features.

Summary

react-native-cli is a stable and widely-used tool for React Native development, offering extensive community support and integration with the React Native ecosystem. However, it may lack some of the performance improvements and newer features found in react-native-new-architecture. The new architecture repository focuses on implementing advanced concepts like Fabric and TurboModules, potentially offering better performance and more modern development paradigms. Developers should consider their project requirements and familiarity with React Native when choosing between these options.

17,543

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!

Pros of Ignite

  • Provides a complete boilerplate with pre-configured tools and best practices
  • Includes a CLI for generating components, screens, and other project elements
  • Offers a rich ecosystem of plugins and extensions

Cons of Ignite

  • May include unnecessary features or dependencies for some projects
  • Steeper learning curve for developers new to the Ignite ecosystem
  • Less flexibility in project structure compared to a custom setup

Code Comparison

React Native New Architecture:

import { TurboModule, TurboModuleRegistry } from 'react-native';

interface Spec extends TurboModule {
  multiply(a: number, b: number): Promise<number>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('NativeCalculator');

Ignite:

import { ApiResponse } from 'apisauce'
import { Api } from './api'
import { GetCharactersResult } from './api.types'

export class CharacterApi {
  private api: Api

  constructor(api: Api) {
    this.api = api
  }

  async getCharacters(): Promise<GetCharactersResult> {
    const response: ApiResponse<any> = await this.api.apisauce.get('character')
    // ... process response
  }
}

Summary

React Native New Architecture focuses on improving performance and bridging native and JavaScript code, while Ignite provides a comprehensive starter kit for React Native projects. The choice between them depends on project requirements and developer preferences.

33,519

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

Pros of Expo

  • Simplified development workflow with a comprehensive set of tools and services
  • Easier deployment and over-the-air updates without app store submissions
  • Extensive library of pre-built components and APIs

Cons of Expo

  • Limited access to native modules and custom native code
  • Larger app size due to included libraries and dependencies
  • Potential performance limitations for complex applications

Code Comparison

React Native New Architecture:

import { TurboModule, TurboModuleRegistry } from 'react-native';

interface Spec extends TurboModule {
  multiply(a: number, b: number): Promise<number>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('NativeCalculator');

Expo:

import { NativeModules } from 'expo-modules-core';

const { ExpoCalculator } = NativeModules;

export default {
  multiply: (a: number, b: number) => ExpoCalculator.multiply(a, b),
};

The React Native New Architecture example showcases the use of TurboModules for native module integration, while the Expo example demonstrates a simpler approach using Expo's native module system. The React Native New Architecture offers more fine-grained control and potentially better performance, but Expo provides a more straightforward implementation at the cost of some flexibility.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

React Native New Architecture Working Group

The intention of this repository is to coordinate and support the rollout of the React Native New Architecture. We have provided guides and a discussion space for this purpose.

You can find New Architecture updates here.

Guides

Discussion

This repository is also a place for discussion and feedback on the New Architecture. You can access it by heading over to the Discussions Tab on Github.

Sections

We've created some sections to keep the discussion focused.

TitleTopic
Announcements 📣General announcements about this working group.
Deep Dive 🐳Sharing deep dives and technical-specific topics
Documentation 📚A place to chat about the New Architecture documentation and migration material
Libraries 🛠A place to chat about 3rd party libraries and their migration story to the New Architecture
Q&A 🤝A place to ask the community for help on the New Architecture topics
Releases 🏁Updates on New Architecture in each release