Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where are the types for rnmapbox? E.G: "FeatureCollection" types? #3548

Closed
eybel opened this issue Jun 25, 2024 · 4 comments
Closed

Where are the types for rnmapbox? E.G: "FeatureCollection" types? #3548

eybel opened this issue Jun 25, 2024 · 4 comments

Comments

@eybel
Copy link

eybel commented Jun 25, 2024

Environment

  • Dev OS: [e.g. OSX 11.0.1, Win10]
  • @rnmapbox/maps version: [eg. 10.0.15]
  • React Native version: [eg. 0.72.6]
  • Expo version: [eg. 49.0.0]

Steps to reproduce

react-native init sample --version [email protected]
cd sample
npm install rnmapbox/maps#main --save
# or released version `npm install @rnmapbox/[email protected] --save`
react-native run-android

I cant find the types for MapBox. Where are they? Do I have to install @types/mapbox-gl?

import { FeatureCollection } from "@rnmapbox/maps"; // cant find the module here.

I have latest typescript version.

@mfazekas
Copy link
Contributor

@eybel I'm not sure we use FeatureCollection type in our interface.

Please use

import type { FeatureCollection } from '@turf/helpers';

@eybel
Copy link
Author

eybel commented Jun 25, 2024

@eybel I'm not sure we use FeatureCollection type in our interface.

Please use

import type { FeatureCollection } from '@turf/helpers';

I havent used that, is an external package?

There is this alternative, but I am not sure whats the best option.

import { FeatureCollection } from "geojson";

@mfazekas
Copy link
Contributor

I'm pretty sure turfjs and geojson type definitions are compatible.

@eybel
Copy link
Author

eybel commented Jun 26, 2024

'@turf/helpers'

Alright then, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants