final-form / final-form/react-final-form

Confusing error message when using an empty object for a decorator.

Open
#813 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### **feature request**

### What is the current behavior?
If you pass in an empty object into an array of decorators, you get an error that is difficult to track down. I encountered this error because I had a placeholder decorator that was just an empty object.

Here is the error message:
Screen Shot 2020-06-22 at 12 17 44 PM

### What is the expected behavior?
A handled error that states decorators must have at least one key/field.

### Sandbox Link

### What's your environment?
react-final-form version: ^6.5.0
final-form version: ^4.20.0
macOS Mojave version: 10.14.6
node version: 10.16.3

### Other information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.