Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'style') when dynamically adding an additional panel #53

Open
MaksimAndreevich opened this issue Jun 15, 2022 · 0 comments

Comments

@MaksimAndreevich
Copy link

MaksimAndreevich commented Jun 15, 2022

In our application, by default, two panels are used. But on pressing the button of an event one more panel is added.
Panel sizes are also saved in store mobx.

When the component is loaded in the store for the first time, the panelWidths array is saved using onUpdate , but when after that I try to call another panel on click, I get an error

 <PanelGroup
         onUpdate={(e: Array<any>) => {                              // when updating panels, write update state
           accountStore.setSizesPanel(e);
         }}
         panelWidths={accountStore.panelWidthsSettings}               // read state from store
       >

         <Panel0 / >

         {accountStore.isVisibleCustomPanel() ? <Panel1 /> : null}.     // appears on user click

         <Panel2 />

  </PanelGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant