React Native – Button

Button is a basic component for handling user interactions. It renders a native button and supports custom text and onPress handling.

Use Cases:

  • Simple user interactions like submitting a form, triggering actions, or navigating to different screens.

Example:

import React from 'react';
import { View, Button, Alert, StyleSheet } from 'react-native';

const App = () => {
  return (
    <View style={styles.container}>
      <Button
        title="Press me"
        onPress={() => Alert.alert('Button pressed!')}
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default App;

Tutorials Deck

TutorialsDeck is striving to provide the best learning material on technical and non-technical subjects.

Languages

Web Technologies

Database

Trending Technologies

© 2024. All rights reserved.

Contact Us @ tutorialsdeck06@gmail.com