F
F
fronter-up2017-11-20 18:22:07
JavaScript
fronter-up, 2017-11-20 18:22:07

Clustering markers on the server, react-leaflet?

Good afternoon! I beg you to help!
Please explain how to make the MarkerClusterGroup component for react-leaflet work with server side rendering ?
For the map itself I use react-leaflet-universal, but it doesn't work for clustering.
I try to do it like this

let MarkerClusterGroup;

...

componentDidMount() {
    MarkerClusterGroup = require('react-leaflet-markerclusterr');
  }

Gives errors
warning.js: 33 Warning: React.createElement: type is invalid - expected a string (for built-in components) or a class / function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports
.
I do not understand what to do with this
I will be grateful for any help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Bobylev, 2017-11-27
@dpigo

Check out these links:
https://github.com/YUzhva/react-leaflet-markerclus...
https://github.com/masotime/react-leaflet-universa...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question