json React / Redux片段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json React / Redux片段相关的知识,希望对你有一定的参考价值。

{
	"reactClassComponent": {
		"prefix": "rcc",
		"body": [
			"import React, { Component } from 'react';",
			"import { string } from 'prop-types';",
			"",
			"export default class ${1} extends Component {",
			"    static propTypes = {",
			"        className: string",
			"    };",
			"",
			"    render() {",
			"        const { className } = this.props;",
			"",
			"        return (",
			"            <div className={className} />",
			"        );",
			"    }",
			"}"
		],
		"description": "create react component"
	},

	"reactClassPureComponent": {
		"prefix": "rcpc",
		"body": [
			"import React, { PureComponent } from 'react';",
			"import { string } from 'prop-types';",
			"",
			"export default class ${1} extends PureComponent {",
			"    static propTypes = {",
			"        className: string",
			"    };",
			"",
			"    render() {",
			"        const { className } = this.props;",
			"",
			"        return (",
			"            <div className={className} />",
			"        );",
			"    }",
			"}"
		],
		"description": "create react pure component"
	}
}

以上是关于json React / Redux片段的主要内容,如果未能解决你的问题,请参考以下文章

json package.json React&Redux deps

实现 Redux 到 React 以从提供的端点返回 JSON 数据

json npm列表(例如react redux)

如何在 React/Redux 中获取和传递对象(JSON API)?

将状态传递给 React/Redux 中的递归嵌套组件

json Pluralsight上的“在ES6中构建React和Redux中的应用程序”的Package.json文件