1

I am new to react and I want to connect it with a lib inside the component. For example I want to create a map component and I dpn't want to use any existing wrappers for mapboxGl. I want to use it like this https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js'> inside the component. I know that I can connect it in index.html, but is there a way to connect from component. Something like

import map from 'https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js';

And what is there is no npm module for this lib?

Thanks.

1

1 Answer 1

1

You should be using npm to gather packages to react.

npm install --save mapbox-gl

Then you will be able to import this package to your project

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.