Giter VIP home page Giter VIP logo

ife-code-snippets's Introduction

This extension provides you React/TS/JS snippets for VS Code

๐Ÿ“š Supported languages (file extensions)

  • JavaScript (.js)
  • JavaScript React (.jsx)
  • TypeScript (.ts)
  • TypeScript React (.tsx)

๐Ÿ“– Snippets

Below is a list of all available snippets and the triggers of each one. The โ‡ฅ means the TAB key.

๐Ÿ“ฆ Import package

Trigger Content Description
imr import React from 'react';
imfc import React, { Fragment, Component } from 'react';
imhs import React, { useState, useContext, useEffect, useCallback, useMemo } from 'react';

imall

import React, { Fragment, Component } from 'react';
import { observer, inject } from 'mobx-react';
import { toJS } from 'mobx';
import styled from 'styled-components';
import { Button } from 'antd';

๐Ÿช React hooks

Trigger Content Description
uses const [, set] = useState(); useState
usee useEffect(() => { }, []); useEffect
usec const = useContext(); useContext
usecb const memoizedCallback = useCallback(() => {doSomething(a, b)},[a, b],); useCallback
user const = useRef(); useRef
usem const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]); useMemo

๐Ÿš Basic methods

Trigger Content
clog console.log()

๐Ÿ“’ React components

Class Component

cc

export default class  extends Component {
    state = {  }
    render() { 
        return (  );
    }
}

Function Component

fc

export interface Props {
    
}
 
const : React.FC<Props> = () => {
    return (  );
}
 
export default ;

render

render

render() {
    return (
         
    );
}

License

MIT

ife-code-snippets's People

Contributors

zyj1022 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

enterpriseih

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.