How to use state in embedded HTML or run code. Also how can I add interactions to embedded html
Hi,
It’s not possible to use state in embedded HTML. If you are in a run code
interaction you can use it by accessing $state
.
oh thx. Also how can I add interactions to the embedded HTML Is it possible or will I have to wrap the embedded html in a separated div from component store or something. Also is there any way that we can define functions? I couldn’t understand documentation properly would like to know if I can define functions that can use state value and also if I can call these functions through the embedded html if not then it’s just fine
Yes, you can’t add interactions inside the content of the embed HTML, but you should be able to add it by wrapping it with another element.
It’s not possible to define functions through the Studio UI, but you can either use Global Contexts API reference | Learn Plasmic or Registering custom functions | Learn Plasmic to add functions from your codebase to become available in the Studio.