Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Boat Parts (react snippets)New to Visual Studio Code? Get it now.
Boat Parts (react snippets)

Boat Parts (react snippets)

Matt Boatman

|
183 installs
| (1) | Free
Snippets for the way I like writing react code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

boat-parts

Snippets for things I find myself typing a ton, mostly react snippets. Also includes some work related snippets that won't be useful for people outside of Olive.

Snippets

Trigger Content
rcc Class Component (You are probably using local state or lifecycle methods)
rccp Class Component (You are probably using local state or lifecycle methods), with props
rfc Functional React Component
rfcp Functional React Component with Props
ssps Set State Using the Previous State
mstpsh Map State to Props, Shorthand
mstp Map State to Props
mdtp Map Dispatch to Props
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,
ptone PropTypes.oneOf(['News', 'Photos']),
ptoner PropTypes.oneOf(['News', 'Photos']).isRequired,
ptoneof PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
ptoneofr 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,
ptoos PropTypes.objectOf(PropTypes.shape()),
ptoosr PropTypes.objectOf(PropTypes.shape()).isRequired,
ptsh PropTypes.shape({color: PropTypes.string, fontSize: PropTypes.number}),
ptshr PropTypes.shape({color: PropTypes.string, fontSize: PropTypes.number}).isRequired,
ptany A value of any data type
ptanyr A value of any data type that is required
Olive-Components
obtn Button: (optional: className, label, color) (required: onClick)
impobtn import Button from 'olive-components/lib/button';
oiconbtn IconButton: (optional: buttonSize, iconSize, color) (required: onClick)
impoiconbtn import IconButton from 'olive-components/lib/iconButton';
oicon Icon: (optional: size) (required: icon)
impoicon import Icon from 'olive-components/lib/icon';
oinput Input: (optional: required) (required: label, value, onChange)
oinput import Input from 'olive-components/lib/input';
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft