1
- const { Component, createElement } = require ( 'react' )
2
- const storeShape = require ( '../utils/storeShape' )
3
- const shallowEqual = require ( '../utils/shallowEqual' )
4
- const isPlainObject = require ( '../utils/isPlainObject' )
5
- const wrapActionCreators = require ( '../utils/wrapActionCreators' )
6
- const hoistStatics = require ( 'hoist-non-react-statics' )
7
- const invariant = require ( 'invariant' )
1
+ import { Component , createElement } from 'react'
2
+ import storeShape from '../utils/storeShape'
3
+ import shallowEqual from '../utils/shallowEqual'
4
+ import isPlainObject from '../utils/isPlainObject'
5
+ import wrapActionCreators from '../utils/wrapActionCreators'
6
+ import hoistStatics from 'hoist-non-react-statics'
7
+ import invariant from 'invariant'
8
8
9
9
const defaultMapStateToProps = state => ( { } ) // eslint-disable-line no-unused-vars
10
10
const defaultMapDispatchToProps = dispatch => ( { dispatch } )
@@ -21,7 +21,7 @@ function getDisplayName(WrappedComponent) {
21
21
// Helps track hot reloading.
22
22
let nextVersion = 0
23
23
24
- function connect ( mapStateToProps , mapDispatchToProps , mergeProps , options = { } ) {
24
+ export default function connect ( mapStateToProps , mapDispatchToProps , mergeProps , options = { } ) {
25
25
const shouldSubscribe = Boolean ( mapStateToProps )
26
26
const finalMapStateToProps = mapStateToProps || defaultMapStateToProps
27
27
const finalMapDispatchToProps = isPlainObject ( mapDispatchToProps ) ?
@@ -273,5 +273,3 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps, options = {})
273
273
return hoistStatics ( Connect , WrappedComponent )
274
274
}
275
275
}
276
-
277
- module . exports = connect
0 commit comments