xoldyckk
xoldyckk
Explore posts from servers
SSolidJS
Created by xoldyckk on 8/15/2023 in #support
Help me build a custom link component which adheres to solid's principles
@draw.uy
import { ParentComponent, splitProps } from "solid-js";
import { A } from "solid-start";
import { type AnchorProps } from "@solidjs/router";

export const CustomLink: ParentComponent<
{
sameSite: boolean;
} & AnchorProps
> = (props) => {
const [local, remainingProps] = splitProps(props, ["children", "sameSite"]);

return (
<A
target={local.sameSite ? "_self" : "_blank"}
{...remainingProps}
>
{local.children}
</A>
);
};
import { ParentComponent, splitProps } from "solid-js";
import { A } from "solid-start";
import { type AnchorProps } from "@solidjs/router";

export const CustomLink: ParentComponent<
{
sameSite: boolean;
} & AnchorProps
> = (props) => {
const [local, remainingProps] = splitProps(props, ["children", "sameSite"]);

return (
<A
target={local.sameSite ? "_self" : "_blank"}
{...remainingProps}
>
{local.children}
</A>
);
};
So, if I'm understanding this correctly I should extract out the the reactive values I pass down from the parent component in the object local and spread out the remainingProps into the <A> tag? At least for this piece of code.
3 replies
SSolidJS
Created by xoldyckk on 8/15/2023 in #support
Help me build a custom link component which adheres to solid's principles
thanks i'll take a look
3 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
pain
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
Okay some stuff happened, idk what but it suddenly started working
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
if it's not abstracted away then we probably have to do it manually when using query client, then perhaps the only use of defining relations table is for typescript intellisense
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
only the relationName field is available when defining relations with many keyword
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
querying for the child comments is an implementation detail abstracted away from us i believe
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
a child has exactly one parent referenced by the parentCommentId field present on it
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
since the parent can never know how many children it has
13 replies
DTDrizzle Team
Created by xoldyckk on 8/14/2023 in #help
Need help implementing one to many relations for a table on itself
in a one to many relation no
13 replies
TTCTheo's Typesafe Cult
Created by xoldyckk on 1/3/2023 in #questions
How to refetch(refresh) next-auth session manually on the client side?
updated session is returned in the network tab, but the session state doesn't update
7 replies
TTCTheo's Typesafe Cult
Created by xoldyckk on 1/3/2023 in #questions
How to refetch(refresh) next-auth session manually on the client side?
I am returning the session data. The updated session is fetched when I run getSession(). But the session state stored by next auth's session provider that wraps the app doesn't update. It only updates when I refresh the whole page(app), or on a windowRefocusEvent. There's no programmatic way listed on next auth's docs to update the session manually.
7 replies
TTCTheo's Typesafe Cult
Created by xoldyckk on 1/3/2023 in #questions
How to refetch(refresh) next-auth session manually on the client side?
but calling getSession doesn't work
7 replies
TTCTheo's Typesafe Cult
Created by xoldyckk on 1/3/2023 in #questions
How to refetch(refresh) next-auth session manually on the client side?
7 replies
SSolidJS
Created by xoldyckk on 12/11/2022 in #support
Can we use solid's For and Index component for data that isn't stored as a signal?
is it good to create two copies of the same data?
4 replies