Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reduxjs/react-redux
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.0-beta.2
Choose a base ref
...
head repository: reduxjs/react-redux
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.0-beta.3
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 5, 2016

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    4e8b313 View commit details
  2. 5.0.0-beta.3

    timdorr committed Oct 5, 2016

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8c3ecee View commit details
Showing with 2 additions and 44 deletions.
  1. +1 −1 package.json
  2. +1 −17 src/connect/mergeProps.js
  3. +0 −26 test/components/connect.spec.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-redux",
"version": "5.0.0-beta.2",
"version": "5.0.0-beta.3",
"description": "Official React bindings for Redux",
"main": "./lib/index.js",
"module": "es/index.js",
18 changes: 1 addition & 17 deletions src/connect/mergeProps.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
import verifyPlainObject from '../utils/verifyPlainObject'
import warning from '../utils/warning'

export function defaultMergeProps(stateProps, dispatchProps, ownProps) {
if (process.env.NODE_ENV !== 'production') {
const stateKeys = Object.keys(stateProps)

for ( let key of stateKeys ) {
if (typeof ownProps[key] !== 'undefined') {
warning(false, `Duplicate key ${key} sent from both parent and state`)
break
}
}
}

return {
...ownProps,
...stateProps,
...dispatchProps
}
return { ...ownProps, ...stateProps, ...dispatchProps }
}

export function wrapMergePropsFunc(mergeProps) {
26 changes: 0 additions & 26 deletions test/components/connect.spec.js
Original file line number Diff line number Diff line change
@@ -79,32 +79,6 @@ describe('React', () => {
expect(container.context.store).toBe(store)
})


it('should warn if same key is used in state and props', () => {
const store = createStore(() => ({
abc: 'bar'
}))

@connect(({ abc }) => ({ abc }))
class Container extends Component {
render() {
return <Passthrough {...this.props} />
}
}

const errorSpy = expect.spyOn(console, 'error')

TestUtils.renderIntoDocument(
<ProviderMock store={store}>
<Container abc="buz" />
</ProviderMock>
)
errorSpy.destroy()
expect(errorSpy).toHaveBeenCalled()
})



it('should pass state and props to the given component', () => {
const store = createStore(() => ({
foo: 'bar',