'after render' event
See original GitHub issueI would really appreciate having an after render
event fired (or something to that effect!) once the app is re-rendered after render
is emitted. I frequently find myself wanting to bind events, scroll the new elements into view, or focus elements after nanomorph does it’s thing.
The only solution I’ve found so far is to just setTimeout for 25ms, which feels wayy too hacky for production.
Is it possible to use choo-hooks to do this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
React "after render" code? - Stack Overflow
This method is called once after your component is rendered. So your code would look like so. var AppBase = React.createClass({ componentDidMount: ...
Read more >React Hook to Run Code After Render - Dave Ceddia
The short answer is no, not really. useEffect is the only hook that is meant for tying in to the component lifecycle, and...
Read more >Form.AfterRender event (Access) - Microsoft Learn
Occurs after the object represented by the chartObject argument has been rendered. Syntax. expression.AfterRender (drawObject, chartObject).
Read more >Event afterrender | MoMo workshop - GitHub Pages
The afterrender event is being fired after a component is finally rendered (to the DOM) and is very often used if you want...
Read more >Execute JavaScript after the React.js Render Method Completes
The render() takes care of the DOM elements and is invoked every time the component is mounted or updated. Thus ,any JavaScript that...
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
You’ll need to install the
nanocomponent
module by yourself, instantiate it manually and use it in a view.We should create a follow-up issue to document that in choo or nanocomponent. Nanocomponent could use a
load
example. Currently it’s only mentioned in the api but not in an example: https://github.com/choojs/nanocomponent#nanocomponentprototypeloadelA general question is whether we should we add examples for third party libraries to the new choo reference documentation. IMO we should at least mention nanocomponent in some documentation about more advanced use-cases.
You can use https://github.com/choojs/nanocomponent#nanocomponentprototypeafterupdateel
To trigger events after a component updates. That being said, a top level after render event would be handy to trigger global handlers.