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.

unable to set syncErrors in connect mapStateToProps

See original GitHub issue

bug report

What is the current behavior?

unable to set syncErrors in connect mapStateToProps syncErrors will lost in component props. It works if I change the prop name to other than ‘syncErrors’

export default connect(state => ({
  syncErrors: getFormSyncErrors('syncValidation')(state), // not working
  formSyncErrors: getFormSyncErrors('syncValidation')(state), // working
}))(SyncValidationForm);

What is the expected behavior?

able to set syncErrors in connect mapStateToProps

Sandbox Link

https://codesandbox.io/s/qjm0V2n7y

What’s your environment?

tried on https://github.com/erikras/redux-form/tree/master/examples/syncValidation redux-form 6.6.3

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
zijian-etccommented, Jan 3, 2018

The doc here is confusing as it uses syncErrors as the key: https://github.com/erikras/redux-form/blob/master/docs/api/Selectors.md

syncErrors: getFormSyncErrors('myForm')(state),

2reactions
nanianterocommented, Jan 10, 2018

@zijian-etc Yes, just spent a day debugging this issue and all I did was follow the instructions 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to set syncErrors in connect mapStateToProps #2899
What is the current behavior? unable to set syncErrors in connect mapStateToProps syncErrors will lost in component props. It works if I change ......
Read more >
redux-form: ordering connect and reduxForm calls - can't ...
I need to be able to access some of the props mapped into my component via mapStateToProps, in the onSubmit function from reduxForm....
Read more >
Connect: Extracting Data with mapStateToProps - React Redux
As the first argument passed in to connect , mapStateToProps is used for selecting the part of the data from the store that...
Read more >
Synchronous Validation Example - Redux Form
IMPORTANT: Synchronous validation happens on every change to your form data, so, if your field value is invalid, your field.error value will always...
Read more >
3 ways to test mapStateToProps and mapDispatchToProps
3 ways to test mapStateToProps and mapDispatchToProps. You already know that you shouldn't actually test the result of calling connect (the ...
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