react-firebase
react-firebase copied to clipboard
[WIP] Add basic error handling
Some initial ideas to fix #43
Feedback welcome!
This is definitely a missing feature, so thanks for taking a stabb at it.
Tried your solution and it works, but If you don't pass a mergeProps function you won't know if you got errors or not. One solution is to make the defaultMergeProps pass errors as errors prop by default.
With this approach there will always be an errors object with your keys as null.
props: {
firstName: 'Einar',
lastName: 'Löve',
emoji: '👶',
errors: {
firstName: null,
lastName: null,
emoji: null,
},
}
Not ideal.
I tried another approach where the props passed down could be an error instead. Take a look and see if it meets your needs.