typescriptReactClassComponent

    0

    3

    lucycodes42

    JavaScript snippets for React

    First, we import React and Component. Next, we define a type Props and type State. The State type will store the current user's data. Next, we export the class. Finally, we define a render() method which will return a div.

    Library: react

    Shortcut: tsrcc

    import React, { Component } from 'react';
    
    type Props = {}
    
    type State = {}
    
    export default class ${1:filename} extends Component<Props, State> {
      state = {}
    
      render() {
        return (
          <div>first</div>
        )
      }
    }
    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.