Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vscode react snippets

    "custom-fc-react-component": {
        "prefix": "fc",
        "body": [
            "import React from 'react';",
            "import PropTypes from 'prop-types';",
            "",
            "// import './${2:index}.scss';",
            "",
            "const ${1:${CLIPBOARD:NewComponent}} = (props) => {",
            "  const {",
            "    param",
            "  } = props;",
            "",
            "  return (",
            "		<div className="">",
            "		  {param}",
            "		</div>",
            "  );",
            "};",
            "",
            "${1:${CLIPBOARD:NewComponent}}.propTypes = {",
            "  param: PropTypes.bool.isRequired",
            "};",
            "",
            "${1:${CLIPBOARD:NewComponent}}.defaultProps = {",
            "",
            "};",
            "",
            "export default ${1:${CLIPBOARD:NewComponent}};",
            ""
        ],
        "description": "Create new React functional component"
    }
 
PREVIOUS NEXT
Tagged: #vscode #react #snippets
ADD COMMENT
Topic
Name
3+7 =