202 lines
14 KiB
XML
202 lines
14 KiB
XML
|
<templateSet group="React">
|
||
|
<template name="rccp" value="import React, { Component } from 'react'; import PropTypes from 'prop-types'; class $componentName$ extends Component { render() { return ( <div> $END$ </div> ); } } $componentName$.propTypes = { }; export default $componentName$; " description="Creates a React component class with PropTypes and ES6 module system" toReformat="true" toShortenFQNames="true">
|
||
|
<variable name="componentName" expression="" defaultValue=""MyComponent"" alwaysStopAt="true" />
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="rrc" value="import React, { Component } from 'react'; import { connect } from 'react-redux'; class $componentName$ extends Component { render() { return ( <div> $END$ </div> ); } } function mapStateToProps(state) { return { }; } export default connect( mapStateToProps, )($componentName$); " description="Creates a React component class connected to redux" toReformat="true" toShortenFQNames="true">
|
||
|
<variable name="componentName" expression="" defaultValue=""MyComponent"" alwaysStopAt="true" />
|
||
|
<context>
|
||
|
<option name="TypeScript" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="rcfc" value="import React, { Component } from 'react'; import PropTypes from 'prop-types'; class $componentName$ extends Component { constructor(props) { super(props); } componentWillMount() { } componentDidMount() { } componentWillReceiveProps(nextProps) { } shouldComponentUpdate(nextProps, nextState) { } componentWillUpdate(nextProps, nextState) { } componentDidUpdate(prevProps, prevState) { } componentWillUnmount() { } render() { return ( <div> $END$ </div> ); } } $componentName$.propTypes = { }; export default $componentName$; " description="Creates a React component class with PropTypes and all lifecycle methods and ES6 module system" toReformat="true" toShortenFQNames="true">
|
||
|
<variable name="componentName" expression="" defaultValue=""MyComponent"" alwaysStopAt="true" />
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="rsc" value="import React from 'react'; const $componentName$ = () => { return ( <div> $END$ </div> ); }; export default $componentName$; " description="Creates a stateless React component without PropTypes and ES6 module system" toReformat="true" toShortenFQNames="true">
|
||
|
<variable name="componentName" expression="" defaultValue=""MyComponent"" alwaysStopAt="true" />
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="rscp" value="import React from 'react'; import PropTypes from 'prop-types'; const $componentName$ = props => { return ( <div> </div> ); }; $componentName$.propTypes = { $END$ }; export default $componentName$; " description="Creates a stateless React component with PropTypes and ES6 module system" toReformat="true" toShortenFQNames="true">
|
||
|
<variable name="componentName" expression="" defaultValue=""MyComponent"" alwaysStopAt="true" />
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="con" value="constructor(props) { super(props); $END$ } " description="Adds a default constructor for the class that contains props as arguments" toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="conc" value="constructor(props, context) { super(props, context); $END$ } " description="Adds a default constructor for the class that contains props and context as arguments" toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="cwm" value="componentWillMount() { $END$ } " description="Invoked once, both on the client and server, immediately before the initial rendering occurs" toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="cdm" value=" componentDidMount() { $END$ } " description="Invoked once, only on the client (not on the server), immediately after the initial rendering occurs." toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="cwr" value="componentWillReceiveProps(nextProps) { $END$ } " description="Invoked when a component is receiving new props. This method is not called for the initial render." toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="scu" value=" shouldComponentUpdate(nextProps, nextState) { $END$ } " description="Invoked before rendering when new props or state are being received." toReformat="true" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_EXPRESSION" value="true" />
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="cwup" value="componentWillUpdate(nextProps, nextState) { $END$ } " description="Invoked immediately before rendering when new props or state are being received." toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="cdup" value=" componentDidUpdate(prevProps, prevState) { $END$ } " description="Invoked immediately after the component's updates are flushed to the DOM." toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="cwun" value="componentWillUnmount() { $END$ } " description="Invoked immediately before a component is unmounted from the DOM." toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="ren" value=" render() { return ( <div> $END$ </div> ); } " description="When called, it should examine this.props and this.state and return a single child element." toReformat="true" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="ssf" value=" this.setState((state, props) => { return { $END$ }; }); " description="Performs a shallow merge of nextState into current state" toReformat="false" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="pta" value="PropTypes.array," description="Array prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_EXPRESSION" value="false" />
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptar" value="PropTypes.array.isRequired," description="Array prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptb" value="PropTypes.bool," description="Bool prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptbr" value="PropTypes.bool.isRequired," description="Bool prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptf" value="PropTypes.func," description="Func prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptfr" value="PropTypes.func.isRequired," description="Func prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptn" value="PropTypes.number," description="Number prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptnr" value="PropTypes.number.isRequired," description="Number prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="pto" value="PropTypes.object," description="Object prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptor" value="PropTypes.object.isRequired," description="Object prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="pts" value="PropTypes.string," description="String prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptsr" value="PropTypes.string.isRequired," description="String prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="ptnd" value="PropTypes.node," description="Anything that can be rendered: numbers, strings, elements or an array" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptndr" value="PropTypes.node.isRequired," description="Anything that can be rendered: numbers, strings, elements or an array required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptel" value="PropTypes.element," description="React element prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptelr" value="PropTypes.element.isRequired," description="React element prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="pti" value="PropTypes.instanceOf($END$)," description="Is an instance of a class prop type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptir" value="PropTypes.instanceOf($0).isRequired," description="Is an instance of a class prop type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="pte" value="PropTypes.oneOf(['$END$'])," description="Prop type limited to specific values by treating it as an enum" toReformat="true" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="pter" value="PropTypes.oneOf(['$END$']).isRequired," description="Prop type limited to specific values by treating it as an enum required" toReformat="true" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptet" value="PropTypes.oneOfType([ $END$ ])," description="An object that could be one of many types" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptetr" value="PropTypes.oneOfType([ $END$ ]).isRequired," description="An object that could be one of many types required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptao" value="PropTypes.arrayOf($END$)," description="An array of a certain type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptaor" value="PropTypes.arrayOf($END$).isRequired," description="An array of a certain type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptoo" value="PropTypes.objectOf($END$)," description="An object with property values of a certain type" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptoor" value="PropTypes.objectOf($END$).isRequired," description="An object with property values of a certain type required" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_STATEMENT" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptsh" value="PropTypes.shape({ $END$ })," description="An object taking on a particular shape" toReformat="false" toShortenFQNames="true">
|
||
|
<context>
|
||
|
<option name="JS_EXPRESSION" value="false" />
|
||
|
<option name="TS_EXPRESSION" value="true" />
|
||
|
</context>
|
||
|
</template>
|
||
|
<template name="ptshr" value="PropTypes.shape({ $END$ }).isRequired," description="An object taking on a particular shape required" toReformat="false" toShortenFQNames="true">
|
||
|
<context />
|
||
|
</template>
|
||
|
<template name="rcc" value="import React, { Component } from 'react'; class $TM_FILENAME_BASE$ extends Component { render() { return ( <div> $END$ </div> ); } } export default $TM_FILENAME_BASE$;" description="Creates a A higher-order component" toReformat="true" toShortenFQNames="true">
|
||
|
<variable name="TM_FILENAME_BASE" expression="capitalize(camelCase(fileNameWithoutExtension()))" defaultValue="""" alwaysStopAt="true" />
|
||
|
<context />
|
||
|
</template>
|
||
|
</templateSet>
|