Skip to content

React.Component subclasses with Flow #7

@theblang

Description

@theblang

It would be nice to have a live template for a component using flow, propTypes, and defaultProps. See this skeleton on Flow's site.

Maybe something like:

// @flow

import React, {Component} from 'react'

type Props = {}
type State = {}

class $COMPONENT$ extends Component {
    static propTypes = {}
    static defaultProps = {}

    props: Props
    state: State

    constructor(props: Props) {
        super(props)
        this.props = props
        this.state = {}
    }

    render() {
        return (
            <div></div>
        )
    }
}

export default $COMPONENT$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions