This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Marc Krenn
Posted Jun 17 - Read on Facebook

Hey guys,
what's the best practice for classes with nested properties?

The following appears to work but, idk, it looks kinda wrong to me:

Any suggestions?


Jordan Robert Dobson

Seems fine to me.

Jordan Robert Dobson

Why extend base class?

Sigurd Tapio Mannsåker

Depends on the complexity of your class I guess? I do it sometimes for stuff where property names would get too long for convenience otherwise, or if a whole set of properties are optional. I prefer just one level for purely aesthetic reasons when I can, but just do whatever makes for more elegant logic for your class :)

Koen Bok

This makes sense, and is mostly what I do too. I agree that it feels like there might be a prettier way to write it though.

Read the entire post on Facebook