Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates a simple React Native app with a list of todos, adding and removing tasks, and state management using useState.
import React, { useState } from 'react';
import { View, Text, TextInput, Button, FlatList } from 'react-native';
export default function App() {
const [todos, setTodos] = useState([]);
const [text, setText] = useState('');
const addTodo = () => {
setTodos([...todos, { key: String(todos.length), title: text }]);
setText('');
};
return (
<View style={{ padding: 20 }}>
<TextInput value={text} onChangeText={setText} placeholder='New Todo' />
<Button title='Add' onPress={addTodo} />
<FlatList data={todos} renderItem={({ item }) => <Text>{item.title}</Text>} />
</View>
);
}React Native is a popular open-source framework for building cross-platform mobile applications using JavaScript and React, allowing developers to write a single codebase for iOS and Android while delivering near-native performance.
Origin & Creator
Created by Facebook in 2015 and maintained by Meta and the React Native community.
Industrial Note
React Native is widely used for cross-platform mobile apps in startups and enterprises, enabling rapid development with a single codebase while achieving near-native performance.