Search code examples
mapboxreact-starter-kit

Putting Mapbox in React-Starter-Kit


Putting Mapbox in React-Starter-Kit , Im having trouble implementing MapBox in react-starter-kit. I dont know how I could make a component out of a client.

Im using this for npm package of mapbox

I wish I could do

 MapBoxComponent extends Component{


static propTypes = {
    path: PropTypes.string.isRequired,
    content: PropTypes.string.isRequired,
    title: PropTypes.string,
  };

  static contextTypes = {
    onSetTitle: PropTypes.func.isRequired,
  };
 }

Is this possible?

Disclaimer: This is my first time actually, so please bear with me.


Solution

  • There are a couple of React components that wrap mapbox.js and mapboxgl-js:

    Here is a related discussion on github: https://github.com/mapbox/mapbox.js/issues/951