Skip to content

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

Open
@MaksimAndreevich

Description

@MaksimAndreevich

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions