jetbrains-react icon indicating copy to clipboard operation
jetbrains-react copied to clipboard

React.Component subclasses with Flow

Open theblang opened this issue 8 years ago • 0 comments

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$

theblang avatar Jan 21 '17 01:01 theblang