Skip to content

Commit

Permalink
[labs/react] remove StringValued type (#3111)
Browse files Browse the repository at this point in the history
* remove stringvalued

* add changeset

* update changeset to be very very very explicit
  • Loading branch information
taylor-vann committed Jul 12, 2022
1 parent f3e3cdd commit 6158482
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-bees-build.md
@@ -0,0 +1,5 @@
---
'@lit-labs/react': patch
---

Removed the unexposed and unnecessary `StringValued` type used to correlate property names with event listener names.
10 changes: 3 additions & 7 deletions packages/labs/react/src/create-component.ts
Expand Up @@ -55,14 +55,14 @@ const addOrUpdateEventListener = (
* Sets properties and events on custom elements. These properties and events
* have been pre-filtered so we know they should apply to the custom element.
*/
const setProperty = <E extends Element, T>(
const setProperty = <E extends Element>(
node: E,
name: string,
value: unknown,
old: unknown,
events?: StringValued<T>
events?: Events
) => {
const event = events?.[name as keyof T];
const event = events?.[name];
if (event !== undefined) {
// Dirty check event value.
if (value !== old) {
Expand All @@ -84,10 +84,6 @@ const setRef = (ref: React.Ref<unknown>, value: Element | null) => {
}
};

type StringValued<T> = {
[P in keyof T]: string;
};

type Constructor<T> = {new (): T};

/***
Expand Down

0 comments on commit 6158482

Please sign in to comment.