Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewsantarin/519c680ebe73a59bcdb5a78d1d63b995 to your computer and use it in GitHub Desktop.
Save andrewsantarin/519c680ebe73a59bcdb5a78d1d63b995 to your computer and use it in GitHub Desktop.
Snippet: React: Stateless Functional Component With Fragment
<snippet>
<content><![CDATA[
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
export const PROP_TYPES = {
};
export const DEFAULT_PROPS = {
};
export default function ${1:${TM_FILENAME/(.?\w*)(?:\.\w+)*$/$1/g}}(props) {
return (
<${2:Fragment}></${2:Fragment}>
);
}
${1:${TM_FILENAME/(.?\w*)(?:\.\w+)*$/$1/g}}.propTypes = PROP_TYPES;
${1:${TM_FILENAME/(.?\w*)(?:\.\w+)*$/$1/g}}.defaultProps = DEFAULT_PROPS;
]]></content>
<tabTrigger>rsfc-frag</tabTrigger>
<scope>source.js</scope>
<description>React: Stateless Functional Component With Fragment</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment