Skip to content
Live Templates For React
Java
Branch: master
Clone or download
Latest commit 3e3e2b2 Jul 31, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images feat:support react 16.8.0, included hooks. Apr 22, 2019
resources feat: change note Apr 22, 2019
src/com/jinsihou/react/snippets feat: React Snippets 0.1 Oct 19, 2017
.gitignore feat: React Snippets 0.1 Oct 19, 2017
LICENSE Create LICENSE Jul 31, 2019
README.md feat:support react 16.8.0, included hooks. Apr 22, 2019

README.md

ReactSnippets

Live Templates for React in IntelliJ products webstorm and idea.

react_snippets

react_snippets

react_snippets

Trigger Content
rcc class component skeleton
rrc class component skeleton with react-redux connect
rccp class component skeleton with prop types after the class
rcfc class component skeleton that contains all the lifecycle methods
rsc stateless component skeleton
rscp stateless component with prop types skeleton
pt empty propTypes declaration
con class default constructor with props
conc class default constructor with props and context
cwm componentWillMount method
cdm componentDidMount method
cwr componentWillReceiveProps method
scu shouldComponentUpdate method
cwup componentWillUpdate method
cdup componentDidUpdate method
cwun componentWillUnmount method
ren render method
bind binds the this of method inside the constructor
hoc higher-order component
cref creates a ref.
cctx creates a context

Add all the snippets that can be used for prop types.

Trigger Content
pta PropTypes.array,
ptar PropTypes.array.isRequired,
ptb PropTypes.bool,
ptbr PropTypes.bool.isRequired,
ptf PropTypes.func,
ptfr PropTypes.func.isRequired,
ptn PropTypes.number,
ptnr PropTypes.number.isRequired,
pto PropTypes.object,
ptor PropTypes.object.isRequired,
pts PropTypes.string,
ptsr PropTypes.string.isRequired,
ptnd PropTypes.node,
ptndr PropTypes.node.isRequired,
ptel PropTypes.element,
ptelr PropTypes.element.isRequired,
pti PropTypes.instanceOf(ClassName),
ptir PropTypes.instanceOf(ClassName).isRequired,
pte PropTypes.oneOf(['News', 'Photos']),
pter PropTypes.oneOf(['News', 'Photos']).isRequired,
ptet PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
ptetr PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
ptao PropTypes.arrayOf(PropTypes.number),
ptaor PropTypes.arrayOf(PropTypes.number).isRequired,
ptoo PropTypes.objectOf(PropTypes.number),
ptoor PropTypes.objectOf(PropTypes.number).isRequired,
ptsh PropTypes.shape({color: PropTypes.string, fontSize: PropTypes.number}),
ptshr PropTypes.shape({color: PropTypes.string, fontSize: PropTypes.number}).isRequired,

Hooks

All hooks from official docs are supported with hook name prefix.

You can’t perform that action at this time.