Is defining generics of a Component again when it's being used, really necessary in Flamework?

No description
Solution:
apparently you could do something like <A extends Attributes = {}, I extends Tool = Tool>...
Jump to solution
12 Replies
Tester
Tester7h ago
defining generics? wdym ohhh, i mean you could just create item that implements base components with set generics
class Item extends BaseComponent<IAttributesGeneric, IInstanceGeneric>
class Item extends BaseComponent<IAttributesGeneric, IInstanceGeneric>
generics are used only for guards so flamework can tell whether the instance is right and whether you have correct attributes
rei🏳⚧
rei🏳⚧OP7h ago
I have to do it when defining fields though as seen in the image it's confusing If i don't provide those, it complains
Tester
Tester7h ago
hmm?
rei🏳⚧
rei🏳⚧OP7h ago
No description
rei🏳⚧
rei🏳⚧OP7h ago
forgot to add this image too oops
Tester
Tester7h ago
oh so you did baseclass?
Solution
Tester
Tester7h ago
apparently you could do something like <A extends Attributes = {}, I extends Tool = Tool>
rei🏳⚧
rei🏳⚧OP6h ago
is that actually possible i don't think it is let me try real quick WHAT IT WORKS 😭
Tester
Tester6h ago
YAAAY :3
rei🏳⚧
rei🏳⚧OP6h ago
I think the documentations need a bit of an update, but I'm not sure whether this is a typescript thing, or a flamework thing it was vague thank you
Tester
Tester6h ago
i think it's a typescript thing
rei🏳⚧
rei🏳⚧OP6h ago
alright thanks

Did you find this page helpful?