Otonashi
Otonashi
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
well everything is a guess without knowing ts internals
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
however if the props fail overall then it'll rerun and narrow onValueChange to string => void (only to fail for the initial reason)
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
so initially it resolves onValueChange to any => any, which will pass a check against the presumably later resolved generic constraint
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
No description
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
jsx ignores properties with hyphens
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
my guess is if the shape of the props is invalid typescript recalculates them, otherwise it doesn't
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
not just any error that causes inference to change
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
No description
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
i'm not sure if there's a better supertype in this case, ideally it would be something like Component<{ [x: string]?: unknown }> but that's invalid ts
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
reverting the pr and applying
- export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
+ export type ValidComponent = keyof JSX.IntrinsicElements | Component<never> | (string & {});
- export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
+ export type ValidComponent = keyof JSX.IntrinsicElements | Component<never> | (string & {});
seems promising, but that breaks accessing props.component so anyone relying on that will have to work around it
20 replies
SSolidJS
Created by Jakob on 4/24/2024 in #support
`<Dynamic>` function prop args are `any`
afaict this is caused by https://github.com/solidjs/solid/pull/1248, which intentionally adds some magic to prevent the type of props from affecting the inferred type of component; not sure what to do about it
20 replies
SSolidJS
Created by marcusbuffett on 3/29/2024 in #support
createEffect is reactive, JSX isn't
though honestly that's pretty difficult to do so it could be something else
7 replies
SSolidJS
Created by marcusbuffett on 3/29/2024 in #support
createEffect is reactive, JSX isn't
this sounds like somewhere in a parent component you're accessing the result of Show in a non-reactive manner
7 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
so it was both then
47 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
well that might complain about too many args
47 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
const getChildren = children(() => props.children);
...
{(() => {const c = getChildren(); return typeof c === "function" ? c(Option) : c})()}
const getChildren = children(() => props.children);
...
{(() => {const c = getChildren(); return typeof c === "function" ? c(Option) : c})()}
would be better
47 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
it probably works, but i can't really say it's robust
47 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
though if for some reason what you're doing there somehow works the same way in dev and prod (it doesn't if hmr still adds the extra accessor), you could do
{(() => {const c = props.children; return typeof c === "function" ? c(Option) : c})()}
{(() => {const c = props.children; return typeof c === "function" ? c(Option) : c})()}
47 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
const c = children(() => props.children);
...
{typeof c() === "function" ? c()(Option) : c()}
const c = children(() => props.children);
...
{typeof c() === "function" ? c()(Option) : c()}
47 replies
SSolidJS
Created by gabriel on 3/7/2024 in #support
How can I only set the ref for an element once it's been inserted into the DOM?
if you must, use the children helper
47 replies