adhocracy4
adhocracy4 copied to clipboard
maps_react: fix indetermined execution order causing the polygon
callback to be executed before the map object is created. Instead of relying on the refs, use the useMap hook and conditional rendering for the polygon.
Not sure if this is the best approach but for now it makes the maps work again on design-dev
fixes https://github.com/liqd/a4-meinberlin/issues/5582
to reproduce the error add the following to your webpack.dev.js
:
module.exports = merge(common, {
devtool: 'eval-source-map',
optimization: {
'nodeEnv': 'production'
}
})
and try to create a mapidea or proposal
Tasks
- [ ] PR name contains story or task reference
- [ ] Documentation (docs and inline)
- [ ] Tests (including n+1 and django_assert_num_queries where applicable)
- [ ] Changelog