Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderedCallback documentation, spec, and consistency #4073

Open
nolanlawson opened this issue Mar 18, 2024 · 0 comments
Open

renderedCallback documentation, spec, and consistency #4073

nolanlawson opened this issue Mar 18, 2024 · 0 comments
Labels
documentation Bug that needs documentation

Comments

@nolanlawson
Copy link
Contributor

nolanlawson commented Mar 18, 2024

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

@nolanlawson nolanlawson added the documentation Bug that needs documentation label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Bug that needs documentation
Projects
None yet
Development

No branches or pull requests

1 participant