FlexLayout
FlexLayout copied to clipboard
Working with Context Provider
My scenerio: I have a component that contains a React ContextProvider, and it gets rendered with my FlexLayout factory. What I want to do is edit the Tab name (with text and a button that links to a function from the ContextConsumer) after the FlexLayout is done rendering.
Right now the component rendering the flexlayout is trying to pull the function from Consumer before the Provider component is rendered in the tab panel, coming back as undefined.
Question: How do I update the Tab name (by accessing the rendered Provider) AFTER FlexLayout has rendered everything with the factory?
There is an action 'renameTab' that will allow you to change the name, so if you get the node, by its id (model.getNodeById()) or have it saved in your component by passing as a prop from the factory, then you can then apply this action using model.doAction()