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

What is Framer? Join the Community
Return to index
John Lee
Posted Apr 09 - Read on Facebook

Quick Q:
How do I assign custom props after creating a New Class Object?
I have two arrays - images and text. I create a Class component 'myClassObj' and inside each object I have a layer 'myCustomText' - I want to change this prop once I create 'new myClassObj' See image! Thanks!!!

3 Comments

Steve Ruiz

You'd use super _.defaults options, so that the properties you define will overwrite the default object's options rather than replacing the entire set. There's a part about this in the docs under Classes. That @ in image:@[i] might throw an error too.

Sergey Nikishkin

inside class:
@myCustomText = new TextLayer

inside loop:
imagesArr[i].myCustomText.text = "some text"

John Lee

I feel like I'm getting close with:
in Class :
@myCustomLayer = new Layer
__image: imageArr[custom.image]

Inside loop:
imagesArr[i].myCustomLayer.image = ???

Read the entire post on Facebook