Skip to content

Question: open new PanelStack after fetching data and pass the returned data to the new panel? #5887

Answered by invliD
emadabdulrahim asked this question in Q&A
Discussion options

You must be logged in to vote

The PanelStack doesn't assume anything, really. You can open new panels from existing panels using the openPanel prop:

this.props.openPanel({
    component: NewPanelComponent
    props: {
        data: "whatever",
    },
    title: "cool panel",
});

Do note, however, that props are not changeable after a panel has been opened. The props first used to open the panel will forever be the props of that panel until it is closed.

Since you want to load data before opening a panel that shouldn't be an issue, so you could do the following:

interface IFolderPanelProps {
    contents: IFolder[],
}

class FolderPanel extends React.PureComponent<IFolderPanelProps & IPanelProps> {
    public render() {

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adidahiya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #3158 on January 24, 2023 15:18.