question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provider component is not intuitive for passing props

See original GitHub issue

Previously discussed on Twitter: https://twitter.com/dan_abramov/status/635441125013200896

Related code: https://github.com/jackielii/simplest-redux-example/blob/master/index.js#L56

React.render(
  <Provider store={store}>
    {() => <App />}
  </Provider>,
  document.getElementById('root')
);

In order to pass the props, we need one more file to bind the props:

import copy

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Aug 24, 2015

Immutable doesn’t solve this problem. React has to reconcile the tree, whether you use Immutable or something else.

0reactions
tiyecommented, Aug 24, 2015

Fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux provider not provides the props to React Component ...
1 Answer 1 · Yes the same way, I did in my code. The browser throws the props are undefined. Seems the provider...
Read more >
When to use Redux, Context and props - Jakob Lind
This is the most simple and intuitive solution. You can share the state from a root component by passing it down as props....
Read more >
Pass Store Explicitly Into as a Prop to Connect() in React
The last step is to spread the root store object to all the components in the React app by passing it to the...
Read more >
How to use React Context like a pro - Devtrium
Use React Context with a custom Provider. First, we'll create a UserContextProvider component inside of a new file called UserContext.jsx . This ...
Read more >
Quick Tip: Sharing Data in Next.js with React Context
The big advantage in using Context in this situation is you no longer have to worry about passing data around via props; you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found