Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redux: Provide Redux store instance to Layout component #1800

Closed
wants to merge 1 commit into from

Conversation

jordwest
Copy link
Contributor

This PR makes the global Redux store instance available to the Layout component. Some of Layout's children that might want to access the Redux store in the future include:

The Layout container is wrapped in a react-redux Provider, allowing any children to access the Redux store directly via react-redux connect().

@jordwest jordwest added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Framework [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 18, 2015
@jordwest
Copy link
Contributor Author

cc: @aduth @matias @dmsnell & anyone else interested in Redux - any thoughts on this?

@aduth
Copy link
Contributor

aduth commented Dec 18, 2015

The plan in #1496 is to add a <ReduxProvider /> wrapper for the root render in the boot initialization.

https://github.com/Automattic/wp-calypso/blob/bd5419a/client/boot/index.js#L186-L189

/cc @artpi

@@ -163,6 +162,7 @@ function boot() {
// Create layout instance with current user prop
Layout = require( 'layout' );
layout = ReactDom.render( React.createElement( Layout, {
store: reduxStore,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know if we really need that - we can connect components that need access to store using connect down the line.

@artpi
Copy link
Contributor

artpi commented Dec 18, 2015

I connected all of it in and much more in #1496 . Once you start connecting it unfortunately cascades.
In #1496:

  • notices are connected
  • layouts
  • layouts state is moved to global state
  • everything that changes layout state is connected

@jordwest
Copy link
Contributor Author

Ah perfect, thanks for your work on that @artpi. Looks like it's all covered there so I'll close this for now

@jordwest jordwest closed this Dec 18, 2015
@scruffian scruffian removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 18, 2015
@jordwest jordwest deleted the add/redux-store-to-layout branch January 11, 2016 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants