Code Monkey home page Code Monkey logo

Comments (5)

hatmatty avatar hatmatty commented on July 29, 2024 1

For instance let’s say you have a server-sided component that has a default attribute and is connected to a tag. On the client you might want to get that component’s instance by tag and see it’s default attribute. You could just set the default attributes by hand but this is just a bit of quality of life and I don’t think it would be too costly.

Also I might be missing something but @Zyrakia said “modifying the attributes object will not result in any changes on the actual instance“ but on the documentation it states “The attributes object on components is mutable, so you can change the value and it'll change in both the component's copy and on the instance.”

So if the defaults are setting the attributes on the attributes object, and the attributes object is linked to the instance, it would appear from the documentation that defaults set attributes on the instance.

from core.

Fireboltofdeath avatar Fireboltofdeath commented on July 29, 2024 1

rbxts-flamework/components@2cee8e9

from core.

Zyrakia avatar Zyrakia commented on July 29, 2024

I believe this is intentional, modifying the attributes object will not result in any changes on the actual instance. Invalid or missing attributes on the instance are only ignored, not modified.

from core.

Fireboltofdeath avatar Fireboltofdeath commented on July 29, 2024

As said by @Zyrakia, this is intentional behavior. I'm open to hearing use cases on why you want the defaults to be added onto the instance, though.

from core.

jackTabsCode avatar jackTabsCode commented on July 29, 2024

I agree, this behavior is both undefined and confusing and limits my use case. They should be synced IMO, otherwise the “attributes” name is misleading

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.