mariusandra / pigeon-maps

ReactJS Maps without external dependencies
https://pigeon-maps.js.org/
MIT License
3.44k stars 142 forks source link

Demo-map error : Text strings must be rendered within a <Text> component #141

Closed BPich closed 2 years ago

BPich commented 2 years ago

Hi all,

I'm trying to integrate pigeon-maps to my app. When testing with the basic demo from https://pigeon-maps.js.org/docs/installation I get the following error : Component Exception Text strings must be rendered within a component.

drawing

I tested within an empty sandbox project.

Here is my App.js code :

import React from 'react';
import { Map, Marker } from "pigeon-maps"

export default function App() {
  return (
    MyMap()
  );
}

export function MyMap() {
  return (
    <Map height={200} defaultCenter={[50.879, 4.6997]} defaultZoom={11}>
      <Marker width={50} anchor={[50.879, 4.6997]} />
    </Map>
  )
}

I tried to google this issue but no explanation found seems to correspond.

Thank you for your help !

I'm using npm and expo to develop and test my app on my android device. I updated npm and expo packages just in case but doesn't fix the issue.

I include the package.json and package-lock.json in the zip hereafter.

sandBox.zip

mariusandra commented 2 years ago

Hey, unfortunately pigeon-maps is only built to work on the web. It's built with standard web components (e.g. <div /> tags), so I would be very surprised if it would work in React Native.

BPich commented 2 years ago

Crap, was expecting something like that. Thanks for the quick answer.