Skip to content

Not getting the update list of panels when calling api.panels #386

Answered by mathuo
DanielGarciaGuillen asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the description.

Take a read of the below and let me know what you think. I believe the issue here is just a little confusion in terms of how the api object works.

I think one important note is that the api object is not React state. In fact, dockview is mostly written in pure TypeScript for maximum performance and it's internal state has no tie to React. The api object returned is a once-created (singleton) object that can be referenced for the duration of the components lifecycle and there are a number of events attached to the api to listen to state changes such as adding and removing panels.

From the onReady event you can access and maintain a reference to the api from wher…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@benatross
Comment options

Answer selected by mathuo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #382 on November 08, 2023 19:20.