1.0.7 • Published 2 years ago

react-function-snippets v1.0.7

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

React Function Snippets

A minimalist VSCode template plug-in, designed to be concise syntax. 一个极简的VSCode模板插件,设计原则是极简语法

After the installation, run the following command in the JS file, CSS file, or extended file (such as TSX and less). 安装后,在js、css文件及拓展文件(tsx、less等)中输入以下命令使用

Supported Snippets

PrefixSnippet
clconsole.log($0)
cloconsole.log({$0})
clnclassName={styles.$1}$0
stystyle={{ $1 }}
espe.stopPropagation(); e.preventDefault();
cusconst [$1,set$1] = useState($2);
ueuseEffect template
ucuseCallback template
umuseMemo template
ufconst $1 = useRef(${2:null})
imimport $1 from '$2$1' import xx from xx
imoimport { $1 } from '$2' import { a } from b
imrimport * as React from 'react';
iroimport React, { xx } from 'react';
irdimport { useSelector, useDispatch } from 'react-redux';
imaimport { $1 } from 'antd';$0 import { } from antd
imsimport styles from './index.module.less';
icsimport classNames from 'classnames';
isgimport { ReactComponent as $1Svg } from '$1.svg';
elscss text-overflow: ellipsis
sgl& :global($1){$2}; cover styles with global
espe.stopPropagation(); && e.preventDefault();
rcta react component template as follows
rctma react memo component template as follows

rct

import React from 'react';
import styles from './index.module.less';

const FC = () => {
  return (
    <div className={styles.wrap}>
       
    </div>
  );
};
export default FC;

rctm

import { memo } from 'react';
import styles from './index.module.less';
    
const FC = () => {
  return (
    <div className={styles.wrap}>
       
    </div>
  );
};
export default memo(FC);