Comments (3)
My solution would be adding "null" to the possible types of slot
inside the IntrinsicAttributes
interface declared in astro/astro-jsx.d.ts
declare namespace astroHTML.JSX {
export type Child = Node | Node[] | string | number | boolean | null | undefined | unknown;
export type Children = Child | Child[];
interface ElementChildrenAttribute {
// eslint-disable-next-line @typescript-eslint/ban-types
children: {};
}
interface IntrinsicAttributes
extends AstroBuiltinProps,
AstroBuiltinAttributes,
AstroClientDirectives {
slot?: string | null; // <===========================LIKE THIS
children?: Children;
}
Though, I'm not sure if there was a specific reason for this to be of type string | undefined
without null
, while HTMLAttributes has all its attributes of type string | undefined | null
.
from astro.
It seems fine to me to add undefined
! If you're interested in sending a PR for it, we'd gladly accept it.
from astro.
It seems fine to me to add
undefined
!
You mean "to add null
" to IntrinsicAttributes
right? Since that's the one type missing (because slot is defined using ?
) ^-^''
But yes, I will send the PR later today! (I'll take some time to read the "how-to" first though ^^)
from astro.
Related Issues (20)
- ViewTransitions reset scroll position after a form submission HOT 1
- Astro + React - Conditional Render HOT 1
- Experimental rewriting of POST request does not work HOT 3
- Container API usage within an Astro project fails to build when using pnpm
- Repo can't be opened on GitHub codespaces HOT 1
- MDX cannot be used with the Container API HOT 1
- View Transitions Breaking AlpineJs `alpine:init` Event HOT 6
- Invalid MIME type in Picture component HOT 2
- Issue with rendering HTML component as a Astro component's child. [email protected] | @astrojs/[email protected] HOT 5
- Assets imported through seed files points to incorrect URL in prod
- [Container API] Unable to pass props to container.renderToString HOT 1
- Astro:db Seed File Fails to be Loaded | "Failed to load url" HOT 2
- Updating to [email protected] throws errors HOT 3
- Astro update check breaks `astro dev` if offline HOT 2
- `<a>` as first element inside component breaks layout HOT 1
- style define:vars not working on child component HOT 1
- shikiConfig not applying to Code components outside markdown HOT 6
- Base does not change href value in anchors. HOT 4
- lit client-shim uses deprecated apis, throws page speed error HOT 4
- Relative paths configuration is broken HOT 3
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 astro.