menu
announcement

Spectrum will become read-only on August 10, 2021. Learn more about the decision in our official announcement.

Framer

The best prototyping tool for teams. Join our Discord chat for weekly classes and real-time help with Framer. http://framer.com/r/discord?utm=spectrum

Channels
Team

Impot smart component from "./canvas"

March 3, 2021 at 1:14am

Impot smart component from "./canvas"

March 3, 2021 at 1:14am
I ran into a problem when I was trying to use a Smart Component inside of a code component. Is that something that is supported?
For example, I created a Smart Component called "MessageItem", and I wanted to write a code component to inject data into a stack of MessageItems. From my code component, I wrote:
import { MessageItem } from "./canvas";
But I get the error: "cannot find module "./canvas" or its corresponding type declarations"
Adding // above that line produces a runtime error with a similar message.
No messages yet