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.

how to get ownProps?

See original GitHub issue
<Provider store={store}>
    <Counter color="blue" />
</Provider>

if i pass a prop color=ā€œblueā€ to the connected component itā€™s not accessible inside Counter component as a prop. Only props that you return from mapToProps function are passed as constructor props. Redux passes properties as ownProps as the second argument of mapToProps function.

Is it missing from redux-zero or am i doing something wrong ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Gameshcommented, Nov 27, 2017

just tried to recreate it on a sandbox and it works, so probably itā€™s the late hours to blame.

Would be good to have the API documented somewhere, because i only found this searching through redux documentation. Itā€™s not even in the examples.

thanks for redux-zero, i love the simplicity

0reactions
Gameshcommented, Nov 28, 2017

thanks for double checking and fixing šŸ‘

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect: Extracting Data with mapStateToProps - React Redux
With (state, ownProps) , it runs any time the store state is different and ALSO whenever the wrapper props have changed. This means...
Read more >
How can I get ownProps using reselect on redux?
You can do this by connecting the selector to a component using the connect method provided by react-redux, then passing the component propsĀ ......
Read more >
How to access props in mapDispatchToProps - Emma Goto
Accessing ownProps in mapDispatchFromProps. We can also access ownProps from mapDispatchToProps . Here we have the same Button example, butĀ ...
Read more >
Unused ownProps parameter of the React Redux ... - DeepScan
Navigate through detailed description of DeepScan rule.
Read more >
Connect | React Redux
This also determines whether the function will receive ownProps. See notes here. state #. If your mapStateToProps function is declared as taking one...
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