相关文章推荐
聪明的海龟  ·  前端react ...·  3 天前    · 
八块腹肌的冲锋衣  ·  如何从React Native ...·  1小时前    · 
彷徨的斑马  ·  Platform.OnRequestPerm ...·  8 月前    · 
爱看球的毛豆  ·  POI ...·  1 年前    · 
冷静的勺子  ·  jsp中equals用法-掘金·  1 年前    · 

I have used azure maps library with react and follow steps:

https://www.npmjs.com/package/react-azure-maps

npm install react-azure-maps.

and added code snippet in my component and after i build code with npx react-native run-android.

import React from 'react'
import {AzureMap, AzureMapsProvider, IAzureMapOptions} from 'react-azure-maps'
import {AuthenticationType} from 'azure-maps-control'
const option: IAzureMapOptions = {
    authOptions: {
        authType: AuthenticationType.subscriptionKey,
        subscriptionKey: '' // Your subscription key
const DefaultMap: React.FC = () => (
  <AzureMapsProvider>
    <div style={{ height: '300px' }}>
      <AzureMap options={option} />
  </AzureMapsProvider>
export default DefaultMap

Please help me with solution

Error: While trying to resolve module * C:\React Native Setup\safeHubsApps\node_modules\react-azure-maps\index(.native|.android.jsx|.native.jsx|.jsx|.android.js|.native.js|.js|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs) * C:\React Native Setup\safeHubsApps\node_modules\react-azure-maps\index\index(.native|.android.jsx|.native.jsx|.jsx|.android.js|.native.js|.js|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs) at DependencyGraph.resolveDependency (C:\React Native Setup\safeHubsApps\node_modules\metro\src\node-haste\DependencyGraph.js:272:17) at Object.resolve (C:\React Native Setup\safeHubsApps\node_modules\metro\src\lib\transformHelpers.js:177:21) at Graph._resolveDependencies (C:\React Native Setup\safeHubsApps\node_modules\metro\src\DeltaBundler\Graph.js:432:35) at Graph._processModule (C:\React Native Setup\safeHubsApps\node_modules\metro\src\DeltaBundler\Graph.js:218:38) at async Graph._addDependency (C:\React Native Setup\safeHubsApps\node_modules\metro\src\DeltaBundler\Graph.js:314:20) at async Promise.all (index 2) at async Graph._processModule (C:\React Native Setup\safeHubsApps\node_modules\metro\src\DeltaBundler\Graph.js:263:5) at async Graph._traverseDependenciesForSingleFile (C:\React Native Setup\safeHubsApps\node_modules\metro\src\DeltaBundler\Graph.js:207:5) at async Promise.all (index 0) at async Graph.initialTraverseDependencies (C:\React Native Setup\safeHubsApps\node_modules\metro\src\DeltaBundler\Graph.js:191:5)

Ghanshyam Rathod

Apologies for the delayed response.

The error message suggests that the module could not be found at the specified path.

Here are a few things you can try to resolve this issue:

  • Make sure that you have installed the react-azure-maps library correctly using the npm command npm install react-azure-maps.
  • Check if the path specified in the error message is correct and if the library is present in the specified location.
  • Try reinstalling the library using the npm command npm install react-azure-maps.
  • If the issue persists, you can try searching for solutions online or reaching out to the library's support team for further assistance.
  • Hope this helps to start with the troubleshooting and resolve the error. Do let us know how it goes.

    Happy to assist you!