Maynards
Maynards
KPCKevin Powell - Community
Created by Maynards on 2/1/2024 in #front-end
Is it possible to have a child element's height even across cards with CSS only?
No description
15 replies
KPCKevin Powell - Community
Created by Maynards on 1/15/2024 in #front-end
How do I destructure an object that extends multiple interfaces into each of those interfaces?
I'm looking for a way to extract the props, for each interface, from an object that extends multiple interfaces. The use case for this is where I've created a composite component and want to expose all the properties from components A & B on C.
interface A {
a1: string,
a2: string
}

interface B {
b1: string,
b2: string
}

interface C extends A, B {

}

export default function ComponentC({ ...aProps, ...bProps }: C) {
const overrideA1 = `${...aProps.a1} Custom`;

return (
<ComponentA {...aProps} a1={overrideA1}>
<ComponentB {...bProps} />
</ComponentA>
)
}
interface A {
a1: string,
a2: string
}

interface B {
b1: string,
b2: string
}

interface C extends A, B {

}

export default function ComponentC({ ...aProps, ...bProps }: C) {
const overrideA1 = `${...aProps.a1} Custom`;

return (
<ComponentA {...aProps} a1={overrideA1}>
<ComponentB {...bProps} />
</ComponentA>
)
}
I appreciate { ...aProps, ...bProps }: C is not valid, but is merely to simulate the desired outcome.
9 replies
KPCKevin Powell - Community
Created by Maynards on 1/14/2024 in #front-end
How do I overflow/breakout a side menu item label?
No description
25 replies