question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'after render' event

See original GitHub issue

I 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:open
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
marcbachmanncommented, Jan 30, 2018

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#nanocomponentprototypeloadel

A 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.

1reaction
bcomnescommented, Dec 20, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found