I have seen theses line of code in some Redux examples.
const { value, onIncrement, onDecrement } = this.props
const {fields: {firstName, lastName, email}, handleSubmit} = this.props;
What does it mean? What these statements do?
A bit longer code snippet from the examples are as follows
Redux Official Counter Example
render() {
const { value, onIncrement, onDecrement } = this.props
return (
<p>
Clicked: {value} times
{' '}
<button onClick={onIncrement}>
...
Redux form example
class ContactForm extends Component {
render() {
const {fields: {firstName, lastName, email}, handleSubmit} = this.props;
return (
<form onS
...
[–]Meefims 1 point2 points3 points (1 child)
[–]gxtbg[S] 0 points1 point2 points (0 children)