response-redux - , .
dispatch() - , . response-redux .
, , , . , , someAction , dispatch() .
, "" , , , .
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { someAction } from '../myActions';
const MyComponent = (props) => {
// someAction is automatically dispatched for you
// there is no need to call dispatch(props.someAction());
props.someAction();
};
export default connect(null, { someAction })(MyComponent);
, ...
const MyComponent = ({ someAction }) => {
someAction();
};
, , , . someAction(), , , . .
const MyComponent = (props) => {
// we never destructured someAction off of props
// and we're not invoking props.someAction
// that means we're invoking the raw action that was originally imported
// this raw action is not connected, and won't be automatically dispatched
someAction();
};
, response-redux. eslint no-shadow, .