Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-mapbox-ui
Advanced tools
MapboxUI provides a minimal layer of abstraction for composing mapbox-gl UI's in an idiomatic React way.
MapboxUI provides a minimal layer of abstraction for composing mapbox-gl UI's in an idiomatic React way.
This library does not provide out of the box components for mapbox layers, sources, markers, etc. This can easily be achieved with composition. See Usage for an example below.
yarn add react-mapbox-ui
# or
npm i react-mapbox-ui
See TypeDocs.
Composing your own MapboxUI components.
// ./examples/Marker.tsx
import { MapboxUI, useMapboxUIEffect } from "react-mapbox-ui";
import "mapbox-gl/dist/mapbox-gl.css";
const accessToken = "your access token";
const centerCoorindates: LngLatLike = [-79.347015, 43.65107]; // Toronto
type MarkerProps = { coordinates: LngLatLike };
/**
* Creating a <Marker/> component.
* Most of your MapboxUI components will be renderless and hook into MapboxUI context with hooks
* This allows consumers to manage their own Mapbox side effects with effect lifecycles
**/
const Marker: React.FC<MarkerProps> = ({ coordinates }) => {
// useMapboxUIEffect provides you with MapboxUI context wrapped in a useEffect
useMapboxUIEffect(
({ map, mapbox }) => {
const marker = new mapbox.Marker().setLngLat(coordinates).addTo(map);
return () => {
marker.remove();
};
},
[coordinates]
);
return null;
};
const App = () => {
return (
<MapboxUI
accessToken={accessToken}
style={{
height: "100vh",
width: "100%",
}}
defaultCenter={centerCoorindates}
>
<Marker coordinates={centerCoorindates} />
</MapboxUI>
);
};
FAQs
> This was a fork of [`react-mapbox-ui`](https://github.com/eliashussary/react-mapbox-ui)
We found that react-mapbox-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.