Mappedin React SDK - v6.0.1-beta.18

Mappedin React SDK

npm install @mappedin/react-sdk

or

yarn add @mappedin/react-sdk

import React from 'react';
import { MapView, useMapData } from '@mappedin/react-sdk';
import '@mappedin/react-sdk/lib/esm/index.css';

export default function App() {
const { mapData, isLoading, error } = useMapData({
key: '<key>',
secret: '<secret>',
mapId: '<mapId>',
});

if (isLoading) {
return <div>Loading...</div>;
}

if (error) {
return <div>{error.message}</div>;
}

return mapData ? <MapView mapData={mapData} style={{ width: '650px', height: '650px' }}></MapView> : null;
}

For full documentation, read our Getting Started guide on the Developer Portal.