init
This commit is contained in:
29
snippets/rjsx-mode/Redux/hocredux
Normal file
29
snippets/rjsx-mode/Redux/hocredux
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- mode: snippet -*-
|
||||
# uuid: 68de6229-17f5-4bd6-83ef-feaa3a1ccb31
|
||||
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
|
||||
# name: hocComponentWithRedux
|
||||
# key: hocredux
|
||||
# --
|
||||
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
export const ${1:hocComponentName} = (WrappedComponent) => {
|
||||
const hocComponent = (props) => <WrappedComponent {...props} />
|
||||
|
||||
hocComponent.propTypes = {
|
||||
}
|
||||
|
||||
return hocComponent
|
||||
}
|
||||
|
||||
const mapStateToProps = (state, ownProps) => ({
|
||||
|
||||
})
|
||||
|
||||
const mapDispatchToProps = (dispatch, ownProps) => ({
|
||||
|
||||
})
|
||||
|
||||
export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent))
|
||||
Reference in New Issue
Block a user