Skip to content

renderedCallback documentation, spec, and consistency #4073

Open
@nolanlawson

Description

@nolanlawson

We've seen a few inconsistencies with how renderedCallback is called:

We should probably have better documentation and specs for how renderedCallback works, perhaps similar to Lit's docs on the subject. We could also do a reform of renderedCallback to ensure that it works consistently per the spec. It's a good time to do this, now that native lifecycle has landed in LWC v6, so connectedCallback and disconnectedCallback are both correctly working per the DOM spec.

Other areas to consider in the process:

  • @wire – lots of people take data from @wire, update state, and then put if checks in renderedCallback that further sets state (despite this being an anti-pattern)
  • list rendering – can you depend on renderedCallback for all list items when the order changes? (answer: no)

Existing SFDC docs on renderedCallback

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationBug that needs documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions