Skip to main content
Solved

widgetSyncedState always returning empty object


Kevin_Feng

Hi! I’m trying to read the synced state of a widget using a plugin by using widgetSyncedState from the Plugin API. For some reason it’s always returning an empty object?

I know the widget state is not empty because I’ve been setting it with useSyncedState and can see the changes in the widget. But when I try to read the state using the API or even look at the widgetSyncedState property in the console, it’s empty. Am I missing something here? Any help would be appreciated!

Best answer by tank666

figma.com
View original
This topic has been closed for comments

5 replies

tank666
  • 4871 replies
  • August 15, 2023

widgetSyncedState: { [key: string]: any } [readonly]
Returns the synced state stored on the widget. This is only readable by widgets created by the same manifest.id.

figma.com

Kevin_Feng
  • Author
  • New Member
  • 2 replies
  • August 15, 2023

So does that mean it’s not possible to have a plugin read a widget’s state? Are there any workarounds if I want to have a plugin read data from a widget?


tank666
  • 4871 replies
  • Answer
  • August 15, 2023

Kevin_Feng
  • Author
  • New Member
  • 2 replies
  • August 15, 2023

I see, thanks so much!


  • 0 replies
  • August 18, 2023

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings