antvis / LarkMap

A React toolkit for geospatial visualization based on L7.

Home Page:https://larkmap.antv.antgroup.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛 [BUG]在获取sence示例的时候,ref无法正常获取

BGMjie opened this issue · comments

commented

🐛 Bug description [Please make everyone to understand it]

在获取sence示例的时候,ref无法正常获取
TS2322: Type 'MutableRefObject<LarkMapRefAttributes | undefined>' is not assignable to type 'Ref | undefined'.
Type 'MutableRefObject<LarkMapRefAttributes | undefined>' is not assignable to type 'RefObject'.
Types of property 'current' are incompatible.
Type 'LarkMapRefAttributes | undefined' is not assignable to type 'LarkMapRefAttributes | null'.
Type 'undefined' is not assignable to type 'LarkMapRefAttributes | null'.

Please provide a link by forking these links LarkMap or GitHub repo, a minimal reproduction.

  • Required Link to minimal reproduction:

📷 Step to reproduce

image
image

🏞 Expected result

🚑 Any additional [like screenshots]

  • LarkMap Version:
  • 当前版本
  • Platform:
  • windows
commented

刚搜了一下,发现好像是tsconfig里严格模式的原因,将严格模式改为false就没事了
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"@/": ["src/"],
"components/": ["src/components/"],
"utils/": ["src/utils/"]
}
},
"include": ["src"]
}