-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Should this be an RFC?
- This is not a substantial change
Which package is this a feature request for?
SSR (@lit-labs/ssr)
Description
From PR review here: #3605 (comment)
When getting attributes after connectedCallback() is useful for grabbing reflected attributes. While renderAttributes() exists, it would be nice to be able to get the attributes in a more convenient format, whether as NamedNodeMap as Element.attributes returns, or as an object. This was needed for SSR integration with React where the host element rendering is delegated to React and so the attributes needed to be passed to React as part of the props object.
Alternatives and Workarounds
rendererInstance.element?.attributes.
But as noted here
lit/packages/labs/ssr/src/lib/element-renderer.ts
Lines 56 to 60 in 4d69843
| export abstract class ElementRenderer { | |
| // TODO (justinfagnani): We shouldn't assume that ElementRenderer subclasses | |
| // create an element instance. Move this to a base class for renderers that | |
| // do. | |
| element?: HTMLElement; |
we shouldn't expect
.element to always be there.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📋 Triaged