Skip to content

Commit

Permalink
Fixed React lowercasing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Kolton committed Dec 17, 2019
1 parent d9fba22 commit 67372ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ const reactifyWebComponent = (WC: string) => {
return this.ref.current.addEventListener(event, val);
}
if (typeof val === "string" || typeof val === "number") {
this.ref.current[prop] = val;
return this.ref.current.setAttribute(prop, val);
}
if (typeof val === "boolean") {
if (val) {
this.ref.current[prop] = true;
return this.ref.current.setAttribute(prop, val);
}
delete this.ref.current[prop];
return this.ref.current.removeAttribute(prop);
}
this.ref.current[prop] = val;
Expand Down

0 comments on commit 67372ed

Please sign in to comment.