Open dennisat opened 1 year ago
Hello, is anybody there?
The correct way of importing the Circle is import { Circle } from "react-leaflet";
I have attempted this import as well, @CodePhilanthropist, and it seems that this is indeed the correct way it should be. However, I am still encountering the same issue.
Could someone provide the package versions of the dependencies listed below?
Here are my versions:
About the react-leaflet-google-layer
, there is a problem when bumping to v 2.2.0, there is a typescript error that the type
property of ReactLeafletGoogleLayer
is not defined. Super strange error, but let's say that this is out of the scope.
Strange, doesn't any body use typescript???
Using typescript here and this works fine?
import { Circle } from 'react-leaflet'
..
return (
<Circle center={[latitude, longitude]} radius={3} />
)
I am facing the same problem. To get around the situation, I added //@ts-ignore
Bug report in v4
Before opening an issue, make sure to read the contributing guide and understand this is a bug tracker, not a support platform.
Please make sure to check the following boxes before submitting an issue.\ Issues opened without using this template will be closed unless they have a good reason not to follow this template.
Expected behavior
It looks like the types are broken or incomplete.
This import { Circle } import from 'react-leaflet/Circle'
has this error
TS2307: Cannot find module 'react-leaflet/Circle' or its corresponding type declarations.`.But even if we import it as this
import { Circle } from 'react-leaflet/lib/Circle'
, there is another TS error for theradius
property:Property 'radius' does not exist on type 'IntrinsicAttributes & CircleProps & RefAttributes<Circle<any>>'.
;For the last one, digging into the types of the
leaflet@1.9.3
file:node_modules/@types/leaflet/index.d.ts
, there is noCircleOptions
interface.The
CircleOptions
is used from your code innode_modules/@react-leaflet/core/lib/circle.d.ts
as thisinterface CircleProps extends CircleOptions, PathProps
.Actual behavior
import { Circle } from 'react-leaflet/Circle'
.radius
, should be accepted.Steps to reproduce
Is TSX file, import he Circle according to the official documentation:
import { Circle } from 'react-leaflet/Circle'
and compile.