widget lifecycle methods / accessing the div after it has been mounted
See original GitHub issue👋 hello from plotly! we’re working on the next version of the Plotly Jupyter widget in https://github.com/plotly/plotly.py/pull/942
There are some methods in our JS library that require a mounted/attached div
(e.g. to know the size of the mounted div
). However, in the widgets render
method, we only have access to the unmounted/unattached div
.
Are there any component lifecycle methods or events that we can utilize to customize the behaviour of the widget after it has been mounted on the DOM? To start, we would use this behaviour to either resize our plot to fill the container or defer making the plot until the div
has been attached.
Many thanks!
(cc @jmmease)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
flutter: Get notified when `Element` is unmounted only ...
I am currently handling Element directly for my own purpose. My current environment does not allow me to use State .
Read more >The Stateful Widget Lifecycle
When the object is inserted into the tree ( mounted property is set to true ), this method is automatically executed after the...
Read more >Flutter Widgets lifecycle, widget tree and element tree.
The Flutter framework makes a request from the widget using createElement method and then mounts the element to the element tree. Each element...
Read more >Flutter life cycle methods and UI widget communication
This method is the most important one. It is called after 'didChangeDependencies()'. The entire tree of widgets to be rendered relays on this ......
Read more >StatefulWidget lifecycle
All widgets have a bool this.mounted property. It is turns true when the buildContext is assigned. It is an error to call setState...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For some reason the
after-show
event, referenced by ipyleaflet in the code snippet above, wasn’t being triggered for me. But when I dumped out all of the events I got abefore-attach
event followed by anafter-attach
event. And theafter-attach
event is exactly what we needed.Thanks!
Many thanks everyone 🙇