Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewsantarin/a13ae42dc9a0acfd1651ba2514f5e801 to your computer and use it in GitHub Desktop.
Save andrewsantarin/a13ae42dc9a0acfd1651ba2514f5e801 to your computer and use it in GitHub Desktop.
Snippet: React: Stateless Functional Component
<snippet>
<content><![CDATA[
import React 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:div}></${2:div}>
);
}
${1:${TM_FILENAME/(.?\w*)(?:\.\w+)*$/$1/g}}.propTypes = PROP_TYPES;
${1:${TM_FILENAME/(.?\w*)(?:\.\w+)*$/$1/g}}.defaultProps = DEFAULT_PROPS;
]]></content>
<tabTrigger>rsfc</tabTrigger>
<scope>source.js</scope>
<description>React: Stateless Functional Component</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment