通过webstorm快速创建react组件模板

2,011 阅读1分钟
一、点击File,然后点击Settings

二、添加模板

三、模板内容
import React, {Component} from 'react';

export default class ${NAME} extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }

    render() {
        return (
            <div ></div>
        )
    }
} 
四、创建React组件