Skip to content

Instantly share code, notes, and snippets.

@ZYinMD
Last active May 11, 2018 18:25
Show Gist options
  • Save ZYinMD/ccb9ad8aeaeb7b40b7688b8620311e32 to your computer and use it in GitHub Desktop.
Save ZYinMD/ccb9ad8aeaeb7b40b7688b8620311e32 to your computer and use it in GitHub Desktop.
React Component Snippet for Sublime Text 3
<!-- Documentation: http://docs.sublimetext.info/en/latest/extensibility/snippets.html -->
<!-- Clone or save this code as react-component.sublime-snippet into Data/Packages/User. No need to restart Sublime.
(If you Copy-Paste-SaveAs... with Sublime, be careful not to save as .xml. It's actually hard not to) -->
<snippet>
<content>
<![CDATA[
${1:import React, { Component \} from 'react';}
class ${2:ComponentName} extends Component {
render() {
return (
${3:}
);
}
}
export default ${2:ComponentName};
]]>
</content>
<!-- Set a tabTrigger: how to trigger the snippet -->
<tabTrigger>Component</tabTrigger>
<!-- Optional: Set a description for the tabTrigger -->
<description>React.js new Component</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment