emberjs / guides

This repository is DEPRECATED!
https://github.com/ember-learn/guides-source
Other
282 stars 873 forks source link

Flesh out documentation for component lifecycle hooks. #1637

Open rwjblue opened 8 years ago

rwjblue commented 8 years ago

Add information to the guides (likely in The Component Lifecycle) that explains the concept that all DOM interaction should be focused in specific hooks and that those hooks are not ran in FastBoot.

This is a guide specific issue for the work discussed in https://github.com/emberjs/ember.js/issues/14235.

toddjordan commented 8 years ago

From Fastboot documentation https://ember-fastboot.com/docs/user-guide :

Designing Components

Use didInsertElement for client-side DOM manipulation

In FastBoot, we do not invoke either didInsertElement or willInsertElement hooks. If your components have any direct DOM manipulation you would do it in those hooks.

Lifecycle Hooks in FastBoot

FastBoot calls the init, didReceiveAttrs, didUpdateAttrs, willRender and willUpdate hooks. Any code in these hooks will be run inside of FastBoot and should be free of references to browser APIs or DOM manipulation.