-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from rackt/drop-react-0.13-support
Drop support for React 0.13
- Loading branch information
Showing
19 changed files
with
427 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
All notable changes are described on the [Releases](https://github.com/gaearon/react-redux/releases) page. | ||
All notable changes are described on the [Releases](https://github.com/rackt/react-redux/releases) page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Component, PropTypes, Children } from 'react'; | ||
import storeShape from '../utils/storeShape'; | ||
|
||
let didWarnAboutReceivingStore = false; | ||
function warnAboutReceivingStore() { | ||
if (didWarnAboutReceivingStore) { | ||
return; | ||
} | ||
|
||
didWarnAboutReceivingStore = true; | ||
console.error( // eslint-disable-line no-console | ||
'<Provider> does not support changing `store` on the fly. ' + | ||
'It is most likely that you see this error because you updated to ' + | ||
'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + | ||
'automatically. See https://github.com/rackt/react-redux/releases/' + | ||
'tag/v2.0.0 for the migration instructions.' | ||
); | ||
} | ||
|
||
export default class Provider extends Component { | ||
getChildContext() { | ||
return { store: this.store }; | ||
} | ||
|
||
constructor(props, context) { | ||
super(props, context); | ||
this.store = props.store; | ||
} | ||
|
||
componentWillReceiveProps(nextProps) { | ||
const { store } = this; | ||
const { store: nextStore } = nextProps; | ||
|
||
if (store !== nextStore) { | ||
warnAboutReceivingStore(); | ||
} | ||
} | ||
|
||
render() { | ||
let { children } = this.props; | ||
return Children.only(children); | ||
} | ||
} | ||
|
||
Provider.propTypes = { | ||
store: storeShape.isRequired, | ||
children: PropTypes.element.isRequired | ||
}; | ||
Provider.childContextTypes = { | ||
store: storeShape.isRequired | ||
}; |
Oops, something went wrong.