Skip to content

TodoMVC: Basic provider explanation and link #400

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

Closed

Conversation

peteruithoven
Copy link
Contributor

Also see: #397

@srph
Copy link

srph commented Aug 6, 2015

Isn't it preferred to make the Provider the top-most component?

React.render(
  <Provider store={store}>
    {() => <App /> }
  </Provider>,
  mountNode
);

@ghost
Copy link

ghost commented Aug 6, 2015

I believe that in order for hot reloading to work, the Provider component needs to be exported from a module. I'll try to find a reference.

edit, found the reference: reduxjs/redux-devtools#24 (comment)

@gaearon
Copy link
Contributor

gaearon commented Aug 6, 2015

Don't worry about hot reloading yet. Right now to get hot reloading working you need an extra component, a la

const store = ...

export default class Root {
  render() {
    return (
      <Provider store={store}>
        {() => <App />}
      </Provider>
    );
  }
}

Later, we'll remove the need for extra component, when we solve #350.

@gaearon
Copy link
Contributor

gaearon commented Aug 14, 2015

This is out of date, so closing. We need to go through examples to comment in a single take later.

@gaearon gaearon closed this Aug 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants