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

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

I'm having trouble using Framer.Device.deviceType when building a project outside of Framer Studio.

When I add this line to the top of app.js in the latest FramerJS build:
Framer.Device.deviceType = "iphone-6-spacegray"

I get the following error:
Uncaught TypeError: Cannot set property 'deviceType' of undefined

Is this expected behavior? Did I miss a step? I'm pulling this from the docs (http://framer.com/docs/#device.deviceType).

1 Comments

Krzysiek Podruczny

This code below works for me.

# Framer starter kit with iPhone 6 (750x1334)
device = new Framer.DeviceView();
device.setupContext();
device.deviceType = "iphone-6-silver-hand";
device.contentScale = 1;

background = new BackgroundLayer
backgroundColor: "white"

You can also view it on Codepen: http://codepen.io/rivadav/pen/QbMjYL

Read the entire post on Facebook