-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hydration overrides hydrated values when defaults are state objects. #243
Comments
I believe this issue may also apply to attributes, where binds aren't deleted either. |
I don't think this is so much a bug as a bit of unexpected design: Property binds are not unique across Fusion, ie multiple states or raw values can be assigned to the same instance property, but older binds for that same property still remain active. |
Hydrate isn't intended to be used for this use-case where you Hydrate a element already managed by Fusion. |
My purpose for using it was to add custom properties to base objects, as there's no pre-made system in fusion this seemed like the only solution without needing to define every property. |
I talk about this use case explicitly in the context of #206, which nullifies this issue if it goes through:
As such, this issue is currently blocked and not likely to actually ever see the light of day given the other issue is likely to go through. |
Hydrate is being removed, so this double assignment will no longer be an issue. Closing this issue. |
This is most likely similar to #171, however it's a bit hard to explain so I'll post a code example below.
In one of my teams games, we build our UI based off of Themes, these themes have properties such as
font
,text
,background
, etc.This is an example of how a TextLabel component works:
For our spectate system, we use this textlabel component but override the TextColor3 to be a blank white.
We build it this way so that we can have a base component and re-hydrate any custom properties we need.
This poses a very subtle error though, notice how in the Textlabel component function we set
TextColor3
toTheme.text
, when the Theme changes (which happens on load and when the user manually changes), it re-overrides hydrate to be the Text color, not the white color that is expected.Here's a step by step method of what exactly happens:
I believe the main cause of this problem is found here.
The text was updated successfully, but these errors were encountered: