React Native pure component

    0

    0

    Khalid Khan

    React Native companion for Typescript

    This code creates a new interface and class. The AppProps interface defines the properties that an App component may have. The App class extends React.PureComponent and takes in an AppProps object as a constructor parameter. The App class then renders a simple View component with a Text component inside it.

    Library: react-native

    Shortcut: reactnative.component.pure

    import * as React from 'react';
    import { View, StyleSheet, Text } from 'react-native';
    
    export interface AppProps {
    }
    
    export default class App extends React.PureComponent<AppProps, any> {
      constructor(props: AppProps) {
        super(props);
      }
    
      public render() {
        return (
          <View>
              <Text>App</Text>
          </View>
        );
      }
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.