{"id":360665,"date":"2022-01-21T06:08:05","date_gmt":"2022-01-21T14:08:05","guid":{"rendered":"https:\/\/css-tricks.com\/?p=360665"},"modified":"2022-02-28T07:41:25","modified_gmt":"2022-02-28T15:41:25","slug":"context-aware-web-components","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/context-aware-web-components\/","title":{"rendered":"Context-Aware Web Components Are Easier Than You Think"},"content":{"rendered":"\n

Another aspect of web components that we haven\u2019t talked about yet is that a JavaScript function is called whenever a web component is added or removed from a page. These lifecycle callbacks can be used for many things, including making an element aware of its context.<\/p>\n\n\n\n\n\n\n

Article series<\/h3>\n\n\n