Right now, most census calls are fetched only if fetchCensus is set into the ElectionProvider. Not defining this to true and trying to use features like voting (in most cases) will make the components to behave weird, or simply not work as expected.
This is an error from the developer from not setting it, but we should either warn in these situations where it's needed and it's not set, or maybe even set it ourselves when a feature requiring it is rendered.
Personally I've lost around 2h debugging this until I find out I simply forgot setting fetchCensus to the ElectionProvider component 🤦🏼. Something so simple as a warning in the console saying "fetch census not executed because fetchCensus is falsy" would have been more than enough to avoid losing 2h (it's on me since I personally did all this... but more reason to add it).
Right now, most census calls are fetched only if
fetchCensus
is set into theElectionProvider
. Not defining this totrue
and trying to use features like voting (in most cases) will make the components to behave weird, or simply not work as expected.This is an error from the developer from not setting it, but we should either warn in these situations where it's needed and it's not set, or maybe even set it ourselves when a feature requiring it is rendered.
Personally I've lost around 2h debugging this until I find out I simply forgot setting
fetchCensus
to the ElectionProvider component 🤦🏼. Something so simple as a warning in the console saying "fetch census not executed becausefetchCensus
is falsy" would have been more than enough to avoid losing 2h (it's on me since I personally did all this... but more reason to add it).