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

Update make-react.js script to use new @lit-labs/react createComponent options object #1090

Merged
merged 2 commits into from Jan 3, 2023

Conversation

ajmchambers
Copy link
Contributor

@lit-labs/react createComponent wrapper introduced an options object in 1.1.0 (the old way still works but is currently marked as deprecated).

The new approach is documented in the readme and looks like this:

import * as React from 'react';
import {createComponent} from '@lit-labs/react';
import {MyElement} from './my-element.js';

export const MyElementComponent = createComponent({
  tagName: 'my-element',
  elementClass: MyElement,
  react: React,
  events: {
    onactivate: 'activate',
    onchange: 'change',
  },
});

This adjusts the make-react.js script to use the newer approach, also removed unused pascal-case import.

Updated react createComponent to use new options object
@vercel
Copy link

vercel bot commented Dec 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
shoelace ✅ Ready (Inspect) Visit Preview Dec 29, 2022 at 0:45AM (UTC)

Copy link
Member

@claviska claviska left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@claviska claviska merged commit 0e1b792 into shoelace-style:next Jan 3, 2023
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