yasnippet-snippets/snippets/rjsx-mode/Redux/rcredux

34 lines
682 B
Plaintext
Raw Normal View History

2019-02-28 21:03:22 +01:00
# -*- mode: snippet -*-
# uuid: c948b832-8ff1-41b2-a256-ce629dcd4dbe
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
# name: reactClassCompomentRedux
# key: rcredux
# --
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
export class ${1:`(yas-jsx-get-class-name-by-file-name)`} extends Component {
2019-02-28 21:03:22 +01:00
static propTypes = {
${2:prop}: ${3:PropTypes}
}
render() {
return (
<div>
$0
</div>
)
}
}
2019-12-25 14:46:48 +01:00
const mapStateToProps = (state, ownProps) => ({
2019-02-28 21:03:22 +01:00
})
2019-12-25 14:46:48 +01:00
const mapDispatchToProps = (dispatch, ownProps) => ({
2019-02-28 21:03:22 +01:00
2019-12-25 14:46:48 +01:00
})
2019-02-28 21:03:22 +01:00
export default connect(mapStateToProps, mapDispatchToProps)($1)