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

Add renderLit to render-component #370

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

geireann
Copy link
Collaborator

@geireann geireann commented May 13, 2024

This PR adds an additional renderLit function into the riteway/render-component path of this package to support Lit elements. The renderLit function takes in an element parameter of type TemplateResult and returns a Cheerio instance that can be used in the exact same way as the previous render for Lit elements.

The default render method will use renderReact and use the previous implementation.

Todo:

  • Add tests (having an issue with ESM vs CommonJS modules)
  • Update README

@geireann geireann changed the title Add renderLit export to render-component Add renderLit to render-component May 13, 2024
const $ = renderLit(html`<div>Text</div>`);
const contains = match($('.contents').html());

assert({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test would fail, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants