[Solved] Using with Redux
See original GitHub issueHello I am trying to use this library with Redux, but I have to click two times on the color in order to get it displayed (I try with CirclePicker), but the action is dispatched on the first click as expected.
How can I get the good color displayed on the first click ? And why does it work at the second one ?
I call it like
<CirclePicker style={{"margin":"0 auto"}} onChangeComplete={createCategoryColor} />
And the method called simply does
createCategoryColor(color, event){ const { dispatch } = this.props; dispatch(selectColorCreate(color.hex)); }
Do you have any idea please ? This lib is really nice !
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
What is redux and what problem does it solve? - Stack Overflow
1 Answer 1 · Basically, redux allow you to save data into a "store" which can be accessed by all of your components...
Read more >Understanding Redux: A tutorial with examples
In this tutorial, we'll show you what Redux is, why you should use it, and how it works. We'll demo using a simple...
Read more >Still don't understand why you need Redux? Read this...
Redux provides a solution by ensuring that: Your state is wrapped in a store which handles all updates and notifies all code that...
Read more >Redux Fundamentals, Part 5: UI and React
The official Redux Fundamentals tutorial: learn how to use Redux with React. ... One possible solution to this is to change how useSelector ......
Read more >What Problems Does Redux solve with React? | by Zack Grooms
What Problems Does Redux solve with React? · 1. INCREASES PREDICTABILITY. The state becomes predictable in the Redux library. · 2. IT OPTIMIZES...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You also have to pass the active color down into the component:
Hi @casesandberg the problem is still there as I have to click two times on the color in order to get it displayed.
`const colorSlider = ({ input, label, meta: { touched, error }, …custom }) => (<div style={{width:‘50%’}}> <BlockPicker {…input} {…custom}/>
</div> )`<Field color={item.value} triangle="hide" colors={['#000', '#ff0000']} item={item} name={item.key} component={colorSlider}/>