-
Notifications
You must be signed in to change notification settings - Fork 889
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
Typescript declaration seems to be broken at least for the Circle #1077
Comments
Hello, is anybody there? |
The correct way of importing the Circle is |
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 |
Strange, doesn't any body use typescript??? |
Using typescript here and this works fine?
|
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
[email protected]
file:node_modules/@types/leaflet/index.d.ts
, there isno
CircleOptions
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.The text was updated successfully, but these errors were encountered: