Skip to the content.


connectAdvanced(selectorFactory, connectOptions?)


Connects a React component to a Redux store. It is the base for connect() but is less opinionated about how to combine state, props, and dispatch into your final props. It makes no assumptions about defaults or memoization of results, leaving those responsibilities to the caller.


It does not modify the component class passed to it; instead, it returns a new, connected component class for you to use.


Most applications will not need to use this, as the default behavior in connect is intended to work for most use cases.

注意 connectAdvanced是在5.0版本中添加的,connect作为connectAdvanced的特定参数集重新实现。然而,connectAdvanced现在已弃用,并将在未来的React Redux主版本中被删除。

connectAdvanced was added in version 5.0, and connect was reimplemented as a specific set of parameters to connectAdvanced. However, connectAdvanced is now deprecated and will eventually be removed in a future major version of React Redux.




A higher-order React component class that builds props from the store state and passes them to the wrapped component. A higher-order component is a function which accepts a component argument and returns a new component.

Static Properties

Static Methods


All the original static methods of the component are hoisted.




Inject todos of a specific user depending on props, and inject props.userId into the action

import * as actionCreators from './actionCreators'
import { bindActionCreators } from 'redux'

function selectorFactory(dispatch) {
  let ownProps = {}
  let result = {}

  const actions = bindActionCreators(actionCreators, dispatch)
  const addTodo = (text) => actions.addTodo(ownProps.userId, text)

  return (nextState, nextOwnProps) => {
    const todos = nextState.todos[nextOwnProps.userId]
    const nextResult = { ...nextOwnProps, todos, addTodo }
    ownProps = nextOwnProps
    if (!shallowEqual(result, nextResult)) result = nextResult
    return result
export default connectAdvanced(selectorFactory)(TodoApp)