Comments (3)
Astro.props
isn't typed (well, it's Record<string, any>
) if you don't use a Props
interface or cast it. As such, it's no surprise that trying to cast the destructured value will make an error, this is not a bug.
I would recommend to use the official pattern for typing, instead:
https://docs.astro.build/en/guides/typescript/#component-props
from language-tools.
@Princesseuh Interesting. I have other similar code but TS compiler doesn't complain.
Seems all involves CollectionEntry.
from language-tools.
Anyway, I use interface Props {
method and all works now :D
from language-tools.
Related Issues (20)
- 🐛 BUG: Formatting Layout components gives unexpected reults HOT 1
- 🐛 BUG: version 2.8.1 removes trailing comma on save HOT 6
- 🐛 BUG: Using Vue component with optional properties in Astro file cause type error HOT 3
- 🐛 BUG: Astro VSCode extension crashing Typescript language server HOT 13
- Auto import of Astro's navigate() in VS Code defaults to astro/dist/transitions/router HOT 2
- 🐛 BUG: Missing trailing backslash in void elements breaks code highlighting when inside a map method HOT 1
- 💡 RFC: Add {} after =
- 🐛 BUG: The Astro syntax parser freezes Neovim when writing an opening curly brace HOT 1
- 🐛 BUG: extension not doing anything (no syntax color, no intellisense, etc) HOT 4
- 🐛 BUG: Comment shortcut generates `//` within a JSX expression HOT 1
- Is crashing my ts server HOT 1
- Extension causes the JS/TS language server to crash HOT 1
- 🐛 BUG: autocomplete does not work with inline style when Japanese text is included in an element. HOT 1
- 🐛 BUG: 2.8.6 breaks typescript server on VSCode
- 💡 RFC: Add code fix to replace quotes with curly braces
- 🐛 BUG: Moving files results in formatting issues in Svelte files HOT 8
- 🐛 BUG: astro check cannot parse file HOT 3
- 🐛 BUG: Go to problems after version 2.9.0 HOT 6
- 🐛 BUG: Astro check support for Object.groupBy() HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-tools.